all repos — min @ 6af03b71ff51203b93e8473b5ec781d4dcecada5

A small but practical concatenative programming language.

tests/sys.min

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
'test load
'test import

"sys" describe

  ("systest" mkdir "." ls "./systest" contains) assert

  ("systest" cd pwd "systest" match) assert
  ".." cd

  (&ls "\n" split "systest" contains) assert

  ("PATH" env?) assert

  ($PATH length 0 >) assert

  ("TEST" "AAA" putenv $AAA "TEST" ==) assert

  (os length 0 >) assert

  (cpu length 0 >) assert

  ("TEST" "test.txt" fwrite "test.txt" file?) assert

  ("systest" dir?) assert

  ("test.txt" "test2.txt" cp "test2.txt" file?) assert

  ("test.txt" "test1.txt" mv "test1.txt" file?) assert

  ("test2.txt" rm "test1.txt" rm pwd ls "test1.txt" contains :t1 pwd ls "test2" contains t1 and false ==) assert

  ("systest" rmdir pwd ls "systest" contains false ==) assert

  report
  clear-stack
  "systest" rmdir