File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ pub mod reboot;
39
39
40
40
pub mod termios;
41
41
42
- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
43
42
pub mod utsname;
44
43
45
44
pub mod wait;
Original file line number Diff line number Diff line change @@ -50,10 +50,21 @@ fn to_str<'a>(s: *const *const c_char) -> &'a str {
50
50
51
51
#[ cfg( test) ]
52
52
mod test {
53
- use super :: uname;
53
+ #[ cfg( target_os = "linux" ) ]
54
+ #[ test]
55
+ pub fn test_uname_linux ( ) {
56
+ assert_eq ! ( super :: uname( ) . sysname( ) , "Linux" ) ;
57
+ }
58
+
59
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
60
+ #[ test]
61
+ pub fn test_uname_darwin ( ) {
62
+ assert_eq ! ( super :: uname( ) . sysname( ) , "Darwin" ) ;
63
+ }
54
64
65
+ #[ cfg( target_os = "freebsd" ) ]
55
66
#[ test]
56
- pub fn test_uname ( ) {
57
- assert_eq ! ( uname( ) . sysname( ) , "Linux " ) ;
67
+ pub fn test_uname_freebsd ( ) {
68
+ assert_eq ! ( super :: uname( ) . sysname( ) , "FreeBSD " ) ;
58
69
}
59
70
}
You can’t perform that action at this time.
0 commit comments