test: add platform name validation and version component count checks
Extend cross-platform tests to verify Platform.name returns one of seven known OS strings and assert Process.version splits into exactly three numeric components, while fixing missing trailing newline in isPosix test file.
This commit is contained in:
Vendored
+1
-1
@@ -2,4 +2,4 @@ import "os" for Platform
|
||||
|
||||
// Can't test for certain values since this test is cross-platform, but we can
|
||||
// at least make sure it is callable and returns a bool.
|
||||
System.print(Platform.isPosix is Bool) // expect: true
|
||||
System.print(Platform.isPosix is Bool) // expect: true
|
||||
Vendored
+11
@@ -1,5 +1,16 @@
|
||||
import "os" for Platform
|
||||
|
||||
var platforms = [
|
||||
"Windows",
|
||||
"iOS",
|
||||
"OS X",
|
||||
"Unknown",
|
||||
"Linux",
|
||||
"Unix",
|
||||
"POSIX"
|
||||
]
|
||||
|
||||
// Can't test for certain values since this test is cross-platform, but we can
|
||||
// at least make sure it is callable and returns a string.
|
||||
System.print(Platform.name is String) // expect: true
|
||||
System.print(platforms.contains(Platform.name)) // expect: true
|
||||
Reference in New Issue
Block a user