improve tests just a bit (#79)

This commit is contained in:
Josh Goebel 2021-04-28 17:45:50 -04:00 committed by GitHub
parent 9b81aec7e4
commit fcea7ba1d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -5,3 +5,4 @@ System.print(Process.version.isEmpty) // expect: false
var isNumber = Fn.new {|str| Num.fromString(str) != null }
System.print(Process.version.split(".").all(isNumber)) // expect: true
System.print(Process.version.split(".").count) // expect: 3