<commit_before>extern crate regex;
#[path="../src/lsb_release.rs"]
mod lsb_release;
#[path="../src/utils.rs"]
mod utils;

fn file() -> String {
"
Distributor ID:	Debian
Description:	Debian GNU/Linux 7.8 (wheezy)
Release:	7.8
Codename:	wheezy
".to_string()
}

fn arch_file() -> String {
"
LSB Version:	1.4
Distributor ID:	Arch
Description:	Arch Linux
Release:	rolling
Codename:	n/a
".to_string()
}

#[test]
pub fn test_parses_lsb_distro() {
    let parse_results = lsb_release::parse(file());
    assert_eq!(parse_results.distro, Some("Debian".to_string()));
}

#[test]
pub fn test_parses_lsb_version() {
    let parse_results = lsb_release::parse(file());
    assert_eq!(parse_results.version, Some("7.8".to_string()));
}

#[test]
pub fn test_parses_arch_lsb_distro() {
    let parse_results = lsb_release::parse(arch_file());
    assert_eq!(parse_results.distro, Some("Arch".to_string()));
}<commit_msg>test: Test that rolling release is recognized correctly<commit_after>extern crate regex;
#[path="../src/lsb_release.rs"]
mod lsb_release;
#[path="../src/utils.rs"]
mod utils;

fn file() -> String {
"
Distributor ID:	Debian
Description:	Debian GNU/Linux 7.8 (wheezy)
Release:	7.8
Codename:	wheezy
".to_string()
}

fn arch_file() -> String {
"
LSB Version:	1.4
Distributor ID:	Arch
Description:	Arch Linux
Release:	rolling
Codename:	n/a
".to_string()
}

#[test]
pub fn test_parses_lsb_distro() {
    let parse_results = lsb_release::parse(file());
    assert_eq!(parse_results.distro, Some("Debian".to_string()));
}

#[test]
pub fn test_parses_lsb_version() {
    let parse_results = lsb_release::parse(file());
    assert_eq!(parse_results.version, Some("7.8".to_string()));
}

#[test]
pub fn test_parses_arch_lsb_distro() {
    let parse_results = lsb_release::parse(arch_file());
    assert_eq!(parse_results.distro, Some("Arch".to_string()));
}

#[test]
pub fn test_parses_arch_lsb_version() {
    let parse_results = lsb_release::parse(arch_file());
    assert_eq!(parse_results.version, Some("rolling".to_string()));
}
{'fraction_non_alphanumeric': 0.16337611056268508, 'fraction_numerical': 0.007897334649555774, 'mean_word_length': 5.517684887459807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6783383', 'n_tokens_mistral': 772, 'n_tokens_neox': 767, 'n_words': 154}