all repos — min @ 854dc391e4724d549431001635e1523d8e42a672

A small but practical concatenative programming language.

tests/str.min

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
@test
#test

"str" describe
  
  ("a,b,c" "," split ("a" "b" "c") ==) assert

  ("test #1" "[0-9]" search ("1") ==) assert 

  ("This is test #1" "test #([0-9])" search ("test #1" "1") ==) assert 

  ("This is a random string" "random" match true ==) assert

  ("something is not something else" "some" "any" replace "anything is not anything else" ==) assert

  ("MiNiM is a concatenative programming language" "/^minim/i" =~ ("MiNiM") ==) assert

  ("This is a difficult test" "s/difficult/simple/" =~ ("This is a simple test") ==) assert

  ("This is a DIFFICULT\n test" "s/difficult/simple/mis" =~ ("This is a simple\n test") ==) assert

  report
  clear