Skip to content

Commit

Permalink
change ~ (windows) add tests for unknown windows versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed May 27, 2023
1 parent fc8dfa1 commit 6755330
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/platform/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,23 @@ fn test_known_winos_names() {
winos_name(10, 0, 22621, VER_NT_WORKSTATION, VER_SUITE_PERSONAL),
"Windows 11"
);
// test unmatched versions (triggers `_` matches and returns a `default_name`)
assert_eq!(
winos_name(5, 9, 3790, VER_NT_WORKSTATION, VER_SUITE_PERSONAL),
"Windows 5.9"
);
assert_eq!(
winos_name(5, 9, 3790, VER_NT_SERVER, VER_SUITE_SMALLBUSINESS),
"Windows Server 5.9"
);
assert_eq!(
winos_name(6, 9, 9600, VER_NT_WORKSTATION, VER_SUITE_PERSONAL),
"Windows 6.9"
);
assert_eq!(
winos_name(6, 9, 9600, VER_NT_SERVER, VER_SUITE_SMALLBUSINESS),
"Windows Server 6.9"
);
}

#[test]
Expand Down

0 comments on commit 6755330

Please sign in to comment.