all repos — min @ e109d19de0a5cbc4a24240c4fe81f32f2b87ca3f

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" concat  contains) assert

  ("systest" cd . "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 . ls "test1.txt" contains :t1 . ls "test2" contains t1 and false ==) assert

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

  report
  clear-stack
  "systest" rmdir