Skip to content

Commit

Permalink
Change test case function name 'Uos' to' uos'
Browse files Browse the repository at this point in the history
  • Loading branch information
WangMengabc committed May 8, 2024
1 parent b060be8 commit 06fe7a8
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions os_info/src/linux/lsb_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct LsbRelease {
fn retrieve() -> Option<LsbRelease> {
match Command::new("lsb_release").arg("-a").output() {
Ok(output) => {
trace!("lsb_release command returned {:?}", output);
trace!("lsb_release command returned {:?}", output); //日志信息
Some(parse(&String::from_utf8_lossy(&output.stdout)))
}
Err(e) => {
Expand All @@ -76,6 +76,7 @@ fn retrieve() -> Option<LsbRelease> {
}
}

// 解析
fn parse(output: &str) -> LsbRelease {
trace!("Trying to parse {:?}", output);

Expand Down Expand Up @@ -188,21 +189,15 @@ mod tests {
#[test]
fn nobara() {
let parse_results = parse(nobara_file());
assert_eq!(
parse_results.distribution,
Some("NobaraLinux".to_string())
);
assert_eq!(parse_results.distribution, Some("NobaraLinux".to_string()));
assert_eq!(parse_results.version, Some("39".to_string()));
assert_eq!(parse_results.codename, None);
}

#[test]
fn Uos() {
fn uos() {
let parse_results = parse(uos_file());
assert_eq!(
parse_results.distribution,
Some("uos".to_string())
);
assert_eq!(parse_results.distribution, Some("uos".to_string()));
assert_eq!(parse_results.version, Some("20".to_string()));
assert_eq!(parse_results.codename, Some("eagle".to_string()));
}
Expand Down

0 comments on commit 06fe7a8

Please sign in to comment.