all repos — min @ cd909f888b7e714f4be6e11269c2580ad145afaf

A small but practical concatenative programming language.

Added tests.
h3rald h3rald@h3rald.com
Wed, 17 Jun 2020 11:27:12 +0200
commit

cd909f888b7e714f4be6e11269c2580ad145afaf

parent

433172bc4c7c5794a5cc911e72217881fbc8356b

4 files changed, 16 insertions(+), 0 deletions(-)

jump to
M tests/dict.mintests/dict.min

@@ -19,6 +19,10 @@ ({1 :a 2 :b 3 :c} dkeys ("a" "b" "c") ==) assert

({1 :a 2 :b 3 :c} dvalues (1 2 3) ==) assert + (ROOT dtype "module" ==) assert + + ({} dtype "" ==) assert + ({1 :a 2 :b 3 :c 4 :d} ("b" "c") dpick {2 :b 3 :c} ==) assert (2 2 {+ :plus} ^plus 4 ==) assert
M tests/lang.mintests/lang.min

@@ -76,6 +76,9 @@ ((2 3 <) ("YES") when "YES" ==) assert

((2 3 >) ("YES") unless "YES" ==) assert + (1 type "int" ==) assert + ({} type "dict" ==) assert + (ROOT type "dict:module" ==) assert (5 (dup 0 ==) (1 +) (dup 1 -) ( * ) linrec 120 ==) assert ;factorial of 5

@@ -214,6 +217,8 @@

(lite? false ==) assert ({3 :x 5 :y} "point" set-type 'point type?) assert + + ({} :myscope (2 :two 3 :three scope @myscope) -> myscope scope-symbols ("three" "two") ==) assert report ; Tidy up
M tests/logic.mintests/logic.min

@@ -136,6 +136,9 @@ ({} 'module type? false ==) assert

((1 2 3) 'module type? false ==) assert (4 'module type? false ==) assert (logic 'module type?) assert + (1 "int" type?) assert + ("test" "string" type?) assert + (ROOT "module" type?) assert (7 0 / inf ==) assert (-7 0 / -inf ==) assert
M tests/str.mintests/str.min

@@ -23,6 +23,10 @@ ("This is a test" "is" indexof 2 ==) assert

("test #1" "[0-9]" search ("1") ==) assert + ("a" ord 97 ==) assert + + (97 chr "a" ==) assert + ("This is test #1" "test #([0-9])" search ("test #1" "1") ==) assert ("This is a random string" "random" match true ==) assert