Login
7 branches 0 tags
Ben (X13/Void) Removed :array convenience function 94cd247 3 years ago 430 Commits
nujel / binlib / tests.nuj
; Nujel - Copyright (C) 2020-2021 - Benjamin Vincent Schulenburg
; This project uses the MIT license, a copy should be included under /LICENSE

[when [and [!= ARCH "wasm"] popen]
          [test/add '[0 . ""] [repl/run-forked 1]]
          [test/add '[123 . ""] [repl/run-forked [exit 123]]]
          [test/add '[0 . "123"] [repl/run-forked [display 123]]]
          [test/add #t [file/dir? "stdlib"]]
          [test/add #f [file/file? "stdlib"]]
          [test/add #t [file/file? "GNUmakefile"]]
          [test/add #f [file/dir? "GNUmakefile"]]
          [test/add #f [tree/get [file/stat "GNUmakefile"] :error?]]
          [test/add #t [tree/get [file/stat "This-file-should-never-exist.jpeg"] :error?]]
          [test/add #t [> [tree/get [file/stat "GNUmakefile"] :size] 1024]]
          [test/add #t [int? [tree/get [file/stat "GNUmakefile"] :modification-time]]]
          [test/add #t [int? [tree/get [file/stat "GNUmakefile"] :access-time]]]
          [test/add #t [int? [tree/get [file/stat "GNUmakefile"] :mode]]]
          [test/add #t [bool? [tree/get [file/stat "GNUmakefile"] :regular-file?]]]
          [test/add #t [bool? [tree/get [file/stat "GNUmakefile"] :directory?]]]
          [test/add #t [bool? [tree/get [file/stat "GNUmakefile"] :character-device?]]]
          [test/add #t [bool? [tree/get [file/stat "GNUmakefile"] :block-device?]]]
          [test/add #t [bool? [tree/get [file/stat "GNUmakefile"] :named-pipe?]]]]

[test/add #t [tree? environment/variables]]
[test/add #t [string? [tree/get environment/variables 'PATH]]]