all repos — min @ 6ab57998aaf63e146352babcb3e1272ddf19254c

A small but practical concatenative programming language.

Fixed tokenize symbol, migrated tests.
h3rald h3rald@h3rald.com
Sat, 11 May 2024 17:04:15 +0200
commit

6ab57998aaf63e146352babcb3e1272ddf19254c

parent

111ffefaa6d98fd33d9a5ab89646000b8ac59ff7

M minpkg/lib/min_global.nimminpkg/lib/min_global.nim

@@ -36,6 +36,8 @@ of tkBlockDocComment:

return "#||$#||#" % [v] of tkBlockComment: return "#|$#|#" % [v] + of tkCommand: + return "[$#]" % [v] else: return v
M next-release.mdnext-release.md

@@ -10,3 +10,7 @@ - Added a new `from-html` symbol to the `xml` module to parse HTML documents and fragments.

- Added a new `xentity2utf8` symbol to the `xml` module to convert an XML entity to its corresponding UTF-8 string. - Added a new `xescape` symbol to the `xml` module to convert special XML characters into the corresponding XML entities. +### Fixes and Improvements + +- Fixed `tokenize` symbol (wasn't processing commands correctly) +
M tests/crypto.mintests/crypto.min

@@ -1,25 +1,25 @@

'min-test require :test ;;; -"crypto" *test/describe +"crypto" test.describe - ("test" md4 "db346d691d7acc4dc2625db19f9e3f52" ==) *test/assert + ("test" md4 "db346d691d7acc4dc2625db19f9e3f52" ==) test.assert - ("test" md5 "098f6bcd4621d373cade4e832627b4f6" ==) *test/assert + ("test" md5 "098f6bcd4621d373cade4e832627b4f6" ==) test.assert - ("test" sha1 "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" ==) *test/assert + ("test" sha1 "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" ==) test.assert - ("test" sha224 "90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809" ==) *test/assert + ("test" sha224 "90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809" ==) test.assert - ("test" sha256 "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" ==) *test/assert + ("test" sha256 "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" ==) test.assert - ("test" sha384 "768412320f7b0aa5812fce428dc4706b3cae50e02a64caa16a782249bfe8efc4b7ef1ccb126255d196047dfedf17a0a9" ==) *test/assert + ("test" sha384 "768412320f7b0aa5812fce428dc4706b3cae50e02a64caa16a782249bfe8efc4b7ef1ccb126255d196047dfedf17a0a9" ==) test.assert - ("test" sha512 "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" ==) *test/assert + ("test" sha512 "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" ==) test.assert - ("test" encode decode "test" ==) *test/assert + ("test" encode decode "test" ==) test.assert - ("test" "test" aes "test" aes strip "test" ==) *test/assert + ("test" "test" aes "test" aes strip "test" ==) test.assert - *test/report + test.report clear-stack
M tests/dict.mintests/dict.min

@@ -1,37 +1,37 @@

'min-test require :test ;;; -"dict" *test/describe +"dict" test.describe - ((("a" 1)("b" 2)("c" 3)) dictionary? not) *test/assert + ((("a" 1)("b" 2)("c" 3)) dictionary? not) test.assert - ({1 :a 2 :b 3 :c} dictionary?) *test/assert + ({1 :a 2 :b 3 :c} dictionary?) test.assert - ({1 :a 2 :b 3 :c} 'b dget 2 ==) *test/assert + ({1 :a 2 :b 3 :c} 'b dget 2 ==) test.assert - ({1 :a 2 :b 3 :c} :dict1 dict1 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 newdict != and) *test/assert + ({1 :a 2 :b 3 :c} :dict1 dict1 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 newdict != and) test.assert - ({1 :a 2 :b 3 :c} :dict1 dict1 ddup 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 {1 :a 2 :b 3 :c} == and) *test/assert + ({1 :a 2 :b 3 :c} :dict1 dict1 ddup 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 {1 :a 2 :b 3 :c} == and) test.assert - ({1 :a 2 :b 3 :c} :dict1 dict1 'b ddel {1 :a 3 :c} ==) *test/assert + ({1 :a 2 :b 3 :c} :dict1 dict1 'b ddel {1 :a 3 :c} ==) test.assert - ({1 :a 2 :b 3 :c} dkeys ("a" "b" "c") ==) *test/assert + ({1 :a 2 :b 3 :c} dkeys ("a" "b" "c") ==) test.assert - ({1 :a 2 :b 3 :c} dvalues (1 2 3) ==) *test/assert + ({1 :a 2 :b 3 :c} dvalues (1 2 3) ==) test.assert - (global dtype "module" ==) *test/assert + (global dtype "module" ==) test.assert - ({} dtype "" ==) *test/assert + ({} dtype "" ==) test.assert - ({1 :a 2 :b 3 :c 4 :d} ("b" "c") dpick {2 :b 3 :c} ==) *test/assert + ({1 :a 2 :b 3 :c 4 :d} ("b" "c") dpick {2 :b 3 :c} ==) test.assert - (2 2 {+ :plus} /plus 4 ==) *test/assert + (2 2 {+ :plus} /plus 4 ==) test.assert - (2 {(2 3 +) :sum} /sum -> + 7 ==) *test/assert + (2 {(2 3 +) :sum} /sum -> + 7 ==) test.assert - ({a :test} "test" dget-raw /str "a" ==) *test/assert + ({a :test} "test" dget-raw /str "a" ==) test.assert - ({} 'aaa 'test dset-sym {aaa :test} ==) *test/assert + ({} 'aaa 'test dset-sym {aaa :test} ==) test.assert ( {} :archives

@@ -44,11 +44,11 @@ code %code

:archive archives archive code dset @archives ) foreach - archives {{"a" :code} :a {"aa" :code} :aa {"aaa" :code} :aaa} ==) *test/assert + archives {{"a" :code} :a {"aa" :code} :aa {"aaa" :code} :aaa} ==) test.assert ( {1 :a 2 :b 3 :c} dpairs ((1 "a") (2 "b") (3 "c")) == - ) *test/assert + ) test.assert - *test/report + test.report clear-stack
M tests/dstore.mintests/dstore.min

@@ -1,9 +1,9 @@

'min-test require :test ;;; -"dstore" *test/describe +"dstore" test.describe - ("dstore.json" dsinit type "dict:datastore" ==) *test/assert + ("dstore.json" dsinit type "dict:datastore" ==) test.assert ( "dstore.json" dsread :ds

@@ -13,7 +13,7 @@ 1 %test1

2 %test2 dspost dswrite "tests" (pop true) dsquery size 1 == - ) *test/assert + ) test.assert ( "dstore.json" dsread :ds

@@ -23,15 +23,15 @@ 1 %test1

3 %test3 dsput dswrite "tests" (/test1 1 ==) dsquery size 2 == - ) *test/assert + ) test.assert ( "dstore.json" dsread :ds ds "tests/aaa" dsdelete "tests" (/id "aaa" ==) dsquery size 0 == - ) *test/assert + ) test.assert "dstore.json" rm - *test/report + test.report clear-stack
M tests/fs.mintests/fs.min

@@ -1,44 +1,44 @@

'min-test require :test ;;; -"fs" *test/describe +"fs" test.describe "TEST" "test.txt" fwrite - ("test.txt" fsize 4 ==) *test/assert + ("test.txt" fsize 4 ==) test.assert - ("test.txt" fperms 644 >=) *test/assert + ("test.txt" fperms 644 >=) test.assert - ("test.txt" ftype "file" ==) *test/assert + ("test.txt" ftype "file" ==) test.assert - ("test.txt" hidden? false ==) *test/assert + ("test.txt" hidden? false ==) test.assert - ("test.txt" fstats 'type dget "file" ==) *test/assert + ("test.txt" fstats 'type dget "file" ==) test.assert - ("tests" dir?) *test/assert + ("tests" dir?) test.assert - ("tests" exists?) *test/assert + ("tests" exists?) test.assert - ("tests/fs.min" file?) *test/assert + ("tests/fs.min" file?) test.assert - (("a" "b" "c") join-path "a/b/c" ==) *test/assert + (("a" "b" "c") join-path "a/b/c" ==) test.assert - ("/home/h3rald" windows-path "\\home\\h3rald" ==) *test/assert + ("/home/h3rald" windows-path "\\home\\h3rald" ==) test.assert - ("/home/h3rald" absolute-path?) *test/assert + ("/home/h3rald" absolute-path?) test.assert - ("tests/sys.min" expand-filename unix-path . "/tests/sys.min" suffix unix-path ==) *test/assert + ("tests/sys.min" expand-filename unix-path . "/tests/sys.min" suffix unix-path ==) test.assert - ("./../tests" normalized-path unix-path "../tests" ==) *test/assert + ("./../tests" normalized-path unix-path "../tests" ==) test.assert - ((. "tests/global.min") => join-path . relative-path unix-path "tests/global.min" ==) *test/assert + ((. "tests/global.min") => join-path . relative-path unix-path "tests/global.min" ==) test.assert - ("tests/global.min" absolute-path unix-path (. "tests/global.min") => join-path unix-path ==) *test/assert + ("tests/global.min" absolute-path unix-path (. "tests/global.min") => join-path unix-path ==) test.assert - ("./test" absolute-path? not) *test/assert + ("./test" absolute-path? not) test.assert - ("c:/windows" windows-path "c:\\windows" ==) *test/assert + ("c:/windows" windows-path "c:\\windows" ==) test.assert - *test/report + test.report clear-stack "test.txt" rm
M tests/global.mintests/global.min

@@ -1,17 +1,17 @@

'min-test require :test ;;; -"global" *test/describe +"global" test.describe (2 'a define - (3 a + (5 'a define a) -> +) -> a + 12 ==) *test/assert + (3 a + (5 'a define a) -> +) -> a + 12 ==) test.assert - (symbols "a" in? false ==) *test/assert + (symbols "a" in? false ==) test.assert - ('abcdefg defined-symbol? false ==) *test/assert + ('abcdefg defined-symbol? false ==) test.assert 5 :five - (symbols "five" in?) *test/assert + (symbols "five" in?) test.assert ( (1 2 3 4 5 6) :test-data

@@ -27,97 +27,97 @@ test-data def foreach

_2 -> _5 -> _1 -> + + 30 == - ) *test/assert + ) test.assert ( (dup *) ^square 3 square 9 == - ) *test/assert + ) test.assert 'five delete-symbol - (symbols "five" in? false ==) *test/assert + (symbols "five" in? false ==) test.assert - ("3 4 +" eval 7 ==) *test/assert + ("3 4 +" eval 7 ==) test.assert - ("2 2 +" "tests/testload.min" fwrite 'testload load 4 ==) *test/assert + ("2 2 +" "tests/testload.min" fwrite 'testload load 4 ==) test.assert "tests/testload.min" rm - ("2 :two 3 :three" "tests/testrequire.min" fwrite 'testrequire require :tm *tm/two *tm/three + 5 ==) *test/assert + ("2 :two 3 :three" "tests/testrequire.min" fwrite 'testrequire require :tm tm.two tm.three + 5 ==) test.assert "tests/testrequire.min" rm - (2 quote (2) ==) *test/assert + (2 quote (2) ==) test.assert - ((2 3) dequote get-stack (2 3) ==) *test/assert + ((2 3) dequote get-stack (2 3) ==) test.assert - (3 (succ) 3 times 6 ==) *test/assert + (3 (succ) 3 times 6 ==) test.assert - ((2 3 >) ("YES") ("NO") if "NO" ==) *test/assert - ((2 3 <) ("YES") ("NO") if "YES" ==) *test/assert + ((2 3 >) ("YES") ("NO") if "NO" ==) test.assert + ((2 3 <) ("YES") ("NO") if "YES" ==) test.assert - ("NO" (2 3 >) ("YES") when "NO" ==) *test/assert + ("NO" (2 3 >) ("YES") when "NO" ==) test.assert - ((2 3 <) ("YES") when "YES" ==) *test/assert + ((2 3 <) ("YES") when "YES" ==) test.assert - ((2 3 >) ("YES") unless "YES" ==) *test/assert + ((2 3 >) ("YES") unless "YES" ==) test.assert - (1 type "int" ==) *test/assert - ({} type "dict" ==) *test/assert - (global type "dict:module" ==) *test/assert + (1 type "int" ==) test.assert + ({} type "dict" ==) test.assert + (global type "dict:module" ==) test.assert - (5 (dup 0 ==) (1 +) (dup 1 -) ( * ) linrec 120 ==) *test/assert ;factorial of 5 + (5 (dup 0 ==) (1 +) (dup 1 -) ( * ) linrec 120 ==) test.assert ;;factorial of 5 ( ( (pop) ('error dget) ("finally") - ) try get-stack ("MinEmptyStackError" "finally") ==) *test/assert + ) try get-stack ("MinEmptyStackError" "finally") ==) test.assert - ("aaaa" :cd cd "aaaa" ==) *test/assert ;It is possible to shadow sealed symbols in child scopes + ("aaaa" :cd cd "aaaa" ==) test.assert ;;It is possible to shadow sealed symbols in child scopes - (((2 :a1 'a1 seal-symbol 3 :a1) ("failed")) try "failed" ==) *test/assert + (((2 :a1 'a1 seal-symbol 3 :a1) ("failed")) try "failed" ==) test.assert ( 1 :a1 'a1 seal-symbol 'a1 unseal-symbol 2 :a1 - 2 a1 ==) *test/assert + 2 a1 ==) test.assert ( ( ({"TestError" :error "Test Message" :message} raise) (/error) - ) try "TestError" ==) *test/assert + ) try "TestError" ==) test.assert ( - (("test" °test :)) try get-stack ("test") ==) *test/assert + (("test" °test :)) try get-stack ("test") ==) test.assert ( ( (() 1 get) (1) - ) try 1 ==) *test/assert + ) try 1 ==) test.assert - ((a b +) {4 :a 5 :b} with 9 ==) *test/assert + ((a b +) {4 :a 5 :b} with 9 ==) test.assert - ("{\"a\": 1, \"b\": 2.3}" from-json {1 :a 2.3 :b} ==) *test/assert + ("{\"a\": 1, \"b\": 2.3}" from-json {1 :a 2.3 :b} ==) test.assert - ((1 2 3 "aaa" 'q q true) to-json "\r\n" "" replace "\n" "" replace " " "" replace "[1,2,3,\"aaa\",\";sym:'q\",\";sym:q\",true]" ==) *test/assert + ((1 2 3 "aaa" 'q q true) to-json "\r\n" "" replace "\n" "" replace " " "" replace "[1,2,3,\"aaa\",\";sym:'q\",\";sym:q\",true]" ==) test.assert - ((1 2 3 "aaa" 'q q true) to-json from-json (1 2 3 "aaa" 'q q true) ==) *test/assert + ((1 2 3 "aaa" 'q q true) to-json from-json (1 2 3 "aaa" 'q q true) ==) test.assert - (((1 2 3)) :sym1 >sym1 saved-symbols "sym1" in?) *test/assert + (((1 2 3)) :sym1 >sym1 saved-symbols "sym1" in?) test.assert - (<sym1 symbols "sym1" in?) *test/assert + (<sym1 symbols "sym1" in?) test.assert - ('sym1 remove-symbol saved-symbols "sym1" in? false ==) *test/assert + ('sym1 remove-symbol saved-symbols "sym1" in? false ==) test.assert - (0 :temp (1 2 3) (temp + @temp) foreach 6 temp ==) *test/assert + (0 :temp (1 2 3) (temp + @temp) foreach 6 temp ==) test.assert ( (1 +) ^mysucc - 'mysucc source (1 +) ==) *test/assert + 'mysucc source (1 +) ==) test.assert (6 (

@@ -125,48 +125,48 @@ ((3 ==) (false))

((3 <) (false)) ((3 >) (true)) ) case - ) *test/assert + ) test.assert - (time scope-symbols ("datetime" "now" "tformat" "timeinfo" "timestamp" "to-timestamp") ==) *test/assert + (time scope-symbols ("datetime" "now" "tformat" "timeinfo" "timestamp" "to-timestamp") ==) test.assert - (sys scope-sigils ("!" "$" "&") ==) *test/assert + (sys scope-sigils ("!" "$" "&") ==) test.assert - ({3 :a 5 :b} scope-symbols ("a" "b") ==) *test/assert + ({3 :a 5 :b} scope-symbols ("a" "b") ==) test.assert (dev?) - ((opts {true :d} ==) *test/assert) - ((opts {} ==) *test/assert) + ((opts {true :d} ==) test.assert) + ((opts {} ==) test.assert) if - (args first "\.min$" match?) *test/assert + (args first "\\.min$" match?) test.assert - (3 string "3" ==) *test/assert + (3 string "3" ==) test.assert - ("false" boolean false ==) *test/assert + ("false" boolean false ==) test.assert - ("" boolean false ==) *test/assert + ("" boolean false ==) test.assert - (0 boolean false ==) *test/assert + (0 boolean false ==) test.assert - (false boolean false ==) *test/assert + (false boolean false ==) test.assert - (0.0 boolean false ==) *test/assert + (0.0 boolean false ==) test.assert - ("something" boolean true ==) *test/assert + ("something" boolean true ==) test.assert - ("345" integer 345 ==) *test/assert + ("345" integer 345 ==) test.assert - (true integer 1 ==) *test/assert + (true integer 1 ==) test.assert - (3.5 integer 3 ==) *test/assert + (3.5 integer 3 ==) test.assert - (3.5 float 3.5 ==) *test/assert + (3.5 float 3.5 ==) test.assert - (3 float 3.0 ==) *test/assert + (3 float 3.0 ==) test.assert - (false float 0.0 ==) *test/assert + (false float 0.0 ==) test.assert - ("3.678" float 3.678 ==) *test/assert + ("3.678" float 3.678 ==) test.assert ( {1 :a 2 :b 3 :c} (

@@ -174,7 +174,7 @@ (dup /a succ succ %a)

(dup /b succ %b) ) tap {3 :a 3 :b 3 :c} == - ) *test/assert + ) test.assert ( {} :data

@@ -183,7 +183,7 @@ 1 %a

2 %b ) tap {1 :a 2 :b} == - ) *test/assert + ) test.assert ( "" :s1

@@ -193,17 +193,17 @@ (' "2" swap append "" join)

(' "3" swap append "" join @s1 s1) ) tap! s1 "test123" == - ) *test/assert + ) test.assert - (3.4 "test" 1 (int str num) expect (3.4 "test" 1) ==) *test/assert + (3.4 "test" 1 (int str num) expect (3.4 "test" 1) ==) test.assert - ("aaa bbb ccc 2 2 + (2 3 4)" parse (aaa bbb ccc 2 2 + (2 3 4)) ==) *test/assert + ("aaa bbb ccc 2 2 + (2 3 4)" parse (aaa bbb ccc 2 2 + (2 3 4)) ==) test.assert - ({} :myscope (2 :two 3 :three scope @myscope) -> myscope scope-symbols ("three" "two") ==) *test/assert + ({} :myscope (2 :two 3 :three scope @myscope) -> myscope scope-symbols ("three" "two") ==) test.assert - ((2 < 3 and (4 > 2)) >< true) *test/assert + ((2 < 3 and (4 > 2)) >< true) test.assert - ((float 3) >> 3.0 ==) *test/assert + ((float 3) >> 3.0 ==) test.assert ( (

@@ -212,7 +212,7 @@ (str :in ==> str :out)

(in "--" suffix "--" prefix @out) ) :: del"test" "--test--" == - ) *test/assert + ) test.assert ( (

@@ -222,11 +222,11 @@ (in "x" prefix @out)

) :: 'x unseal-sigil 'x delete-sigil 'x defined-sigil? false == - ) *test/assert + ) test.assert ( - {{100 :b} :a} :test *test/a/b 100 == - ) *test/assert + {{100 :b} :a} :test test.a.b 100 == + ) test.assert ( (

@@ -239,7 +239,7 @@ base (dup) n times (*) n times @pr

) ) operator 2 4 pow-mul - 8 == - ) *test/assert + ) test.assert ( (

@@ -260,15 +260,15 @@ false @result

) ) :: nt"flt" - ) *test/assert + ) test.assert - ; (:n ((n integer?) (n 0 >)) &&) 'natural typeclass + ;; (:n ((n integer?) (n 0 >)) &&) 'natural typeclass ( typeclass natural (int :n ==> bool :out) (((n integer?) (n 0 >)) && @out) ) :: - ("typeclass:natural" defined-symbol?) *test/assert + ("typeclass:natural" defined-symbol?) test.assert ( symbol natural-sum (natural :n natural :m ==> natural :result)

@@ -281,9 +281,9 @@ (

(3 -3 natural-sum) (@err) ) try - pop ;Remove 3 that was left on the stack. - (err format-error "expected: natural natural natural-sum" match?) *test/assert - (2 3 natural-sum 5 ==) *test/assert + pop ;;Remove 3 that was left on the stack. + (err format-error "expected: natural natural natural-sum" match?) test.assert + (2 3 natural-sum 5 ==) test.assert ) when

@@ -297,7 +297,7 @@ in %test

@out ) ) :: - ("aaa" test-c 'dict:test-c type?) *test/assert + ("aaa" test-c 'dict:test-c type?) test.assert ( symbol add

@@ -314,8 +314,8 @@ (a b concat @result return)

when ) ) :: - ("a" "b" add "ab" ==) *test/assert - ((1 2 3) (4 5) add (1 2 3 4 5) ==) *test/assert + ("a" "b" add "ab" ==) test.assert + ((1 2 3) (4 5) add (1 2 3 4 5) ==) test.assert (typeclass fiveplus

@@ -349,13 +349,13 @@ ) ::

6 test 11 test and - ) *test/assert + ) test.assert ( {{1 :aa} :a 2 :b} :test1 test1.b test1.a.aa + 3 == - ) *test/assert + ) test.assert - *test/report - ; Tidy up + test.report + ;; Tidy up clear-stack
M tests/http.mintests/http.min

@@ -1,14 +1,14 @@

'min-test require :test ;;; -"http" *test/describe +"http" test.describe "postman-echo.com" :host "https://$1" (host) => % :url - ("$1/get" (url) => % get-content from-json /headers /user-agent "min http-module/$1" (version) => % ==) *test/assert + ("$1/get" (url) => % get-content from-json /headers /user-agent "min http-module/$1" (version) => % ==) test.assert - ("$1/get?test=Hello!" (url) => % "tests/test1.json" :file file download file fread from-json /args /test "Hello!" ==) *test/assert + ("$1/get?test=Hello!" (url) => % "tests/test1.json" :file file download file fread from-json /args /test "Hello!" ==) test.assert "tests/test1.json" rm (

@@ -18,7 +18,7 @@ ("GET" %method)

({"it-it" :Accept-Language} %headers) (request) ) tap /body from-json /headers /accept-language "it-it" == - ) *test/assert + ) test.assert ( {} (

@@ -27,7 +27,7 @@ ("PUT" %method)

({} to-json %body) (request) ) tap /body from-json /data {} == - ) *test/assert + ) test.assert ( {} (

@@ -36,7 +36,7 @@ ("POST" %method)

({"post" :test} to-json %body) (request) ) tap /headers /content-type "^application/json" match? - ) *test/assert + ) test.assert ( {} (

@@ -45,7 +45,7 @@ ("PATCH" %method)

({} to-json %body) (request) ) tap /body from-json /data {} == - ) *test/assert + ) test.assert ( {} (

@@ -53,7 +53,7 @@ ("$1/delete" (url) => % %url)

("DELETE" %method) (request) ) tap /body from-json /url "https://$1/delete" (host) => % == - ) *test/assert + ) test.assert - *test/report + test.report clear-stack
M tests/io.mintests/io.min

@@ -1,14 +1,14 @@

'min-test require :test ;;; -"io" *test/describe +"io" test.describe ("TEST" "test.txt" fwrite - "test.txt" fread "TEST" ==) *test/assert + "test.txt" fread "TEST" ==) test.assert (" - TEST" "test.txt" fappend - "test.txt" fread "TEST - TEST" ==) *test/assert + "test.txt" fread "TEST - TEST" ==) test.assert "test.txt" rm - *test/report + test.report clear-stack
M tests/logic.mintests/logic.min

@@ -1,161 +1,161 @@

'min-test require :test ;;; -"logic" *test/describe +"logic" test.describe - (2 3 <) *test/assert - (3 2 < false ==) *test/assert - (3 3 < false ==) *test/assert - (2.99 3 <) *test/assert - (2 1.99 < false ==) *test/assert - (1.99 1.991 <) *test/assert - (1.99 1.990 < false ==) *test/assert - ("test1" "test2" <) *test/assert - ("test3" "test2" < false ==) *test/assert - ("test2" "test2" < false ==) *test/assert + (2 3 <) test.assert + (3 2 < false ==) test.assert + (3 3 < false ==) test.assert + (2.99 3 <) test.assert + (2 1.99 < false ==) test.assert + (1.99 1.991 <) test.assert + (1.99 1.990 < false ==) test.assert + ("test1" "test2" <) test.assert + ("test3" "test2" < false ==) test.assert + ("test2" "test2" < false ==) test.assert - (2 3 <=) *test/assert - (3 2 <= false ==) *test/assert - (3 3 <=) *test/assert - (2.99 3 <=) *test/assert - (2 1.99 <= false ==) *test/assert - (1.99 1.991 <=) *test/assert - (1.99 1.990 <=) *test/assert - ("test1" "test2" <=) *test/assert - ("test3" "test2" <= false ==) *test/assert - ("test2" "test2" <=) *test/assert + (2 3 <=) test.assert + (3 2 <= false ==) test.assert + (3 3 <=) test.assert + (2.99 3 <=) test.assert + (2 1.99 <= false ==) test.assert + (1.99 1.991 <=) test.assert + (1.99 1.990 <=) test.assert + ("test1" "test2" <=) test.assert + ("test3" "test2" <= false ==) test.assert + ("test2" "test2" <=) test.assert - (2 3 > false ==) *test/assert - (3 2 >) *test/assert - (3 3 > false ==) *test/assert - (2.99 3 > false ==) *test/assert - (2 1.99 >) *test/assert - (1.99 1.991 > false ==) *test/assert - (1.99 1.990 > false ==) *test/assert - ("test1" "test2" > false ==) *test/assert - ("test3" "test2" >) *test/assert - ("test2" "test2" > false ==) *test/assert + (2 3 > false ==) test.assert + (3 2 >) test.assert + (3 3 > false ==) test.assert + (2.99 3 > false ==) test.assert + (2 1.99 >) test.assert + (1.99 1.991 > false ==) test.assert + (1.99 1.990 > false ==) test.assert + ("test1" "test2" > false ==) test.assert + ("test3" "test2" >) test.assert + ("test2" "test2" > false ==) test.assert - (2 3 >= false ==) *test/assert - (3 2 >=) *test/assert - (3 3 >=) *test/assert - (2.99 3 >= false ==) *test/assert - (2 1.99 >=) *test/assert - (1.99 1.991 >= false ==) *test/assert - (1.99 1.990 >=) *test/assert - ("test1" "test2" >= false ==) *test/assert - ("test3" "test2" >=) *test/assert - ("test2" "test2" >=) *test/assert + (2 3 >= false ==) test.assert + (3 2 >=) test.assert + (3 3 >=) test.assert + (2.99 3 >= false ==) test.assert + (2 1.99 >=) test.assert + (1.99 1.991 >= false ==) test.assert + (1.99 1.990 >=) test.assert + ("test1" "test2" >= false ==) test.assert + ("test3" "test2" >=) test.assert + ("test2" "test2" >=) test.assert - (true true ==) *test/assert - (false true == false ==) *test/assert - (true false == false ==) *test/assert - (false false ==) *test/assert - (1 1 ==) *test/assert - ("aaa" "aaa" ==) *test/assert - (1.0 1 ==) *test/assert - ((1 2 3.0) (1.0 2 3) ==) *test/assert - (("a" "b") ("a" "b") ==) *test/assert - (("a" "b" 3) ("a" "b" 4) == false ==) *test/assert - ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) ==) *test/assert + (true true ==) test.assert + (false true == false ==) test.assert + (true false == false ==) test.assert + (false false ==) test.assert + (1 1 ==) test.assert + ("aaa" "aaa" ==) test.assert + (1.0 1 ==) test.assert + ((1 2 3.0) (1.0 2 3) ==) test.assert + (("a" "b") ("a" "b") ==) test.assert + (("a" "b" 3) ("a" "b" 4) == false ==) test.assert + ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) ==) test.assert - (true true != false ==) *test/assert - (false true !=) *test/assert - (true false !=) *test/assert - (false false != false ==) *test/assert - (1 1 != false ==) *test/assert - ("aaa" "aaa" != false ==) *test/assert - ;(1.0 1 != false ==) *test/assert - ;((1 2 3.0) (1.0 2.0 3) != false ==) *test/assert - ;(("a" "b") ("a" "b") != false ==) *test/assert - (("a" "b" 3) ("a" "b" 4) !=) *test/assert - ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) != false ==) *test/assert + (true true != false ==) test.assert + (false true !=) test.assert + (true false !=) test.assert + (false false != false ==) test.assert + (1 1 != false ==) test.assert + ("aaa" "aaa" != false ==) test.assert + ;;(1.0 1 != false ==) *test/assert + ;;((1 2 3.0) (1.0 2.0 3) != false ==) *test/assert + ;;(("a" "b") ("a" "b") != false ==) *test/assert + (("a" "b" 3) ("a" "b" 4) !=) test.assert + ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) != false ==) test.assert - (false not) *test/assert - (true not false ==) *test/assert + (false not) test.assert + (true not false ==) test.assert - (true true and) *test/assert - (true false and false ==) *test/assert - (false true and false ==) *test/assert - (false false and false ==) *test/assert + (true true and) test.assert + (true false and false ==) test.assert + (false true and false ==) test.assert + (false false and false ==) test.assert - (true true or) *test/assert - (true false or) *test/assert - (false true or) *test/assert - (false false or false ==) *test/assert + (true true or) test.assert + (true false or) test.assert + (false true or) test.assert + (false false or false ==) test.assert - (true true xor false ==) *test/assert - (true false xor) *test/assert - (false true xor) *test/assert - (false false xor false ==) *test/assert + (true true xor false ==) test.assert + (true false xor) test.assert + (false true xor) test.assert + (false false xor false ==) test.assert - ("a" string?) *test/assert - (1 string? false ==) *test/assert - (1.0 string? false ==) *test/assert - (true string? false ==) *test/assert - (false string? false ==) *test/assert - (("a" 2 c) string? false ==) *test/assert + ("a" string?) test.assert + (1 string? false ==) test.assert + (1.0 string? false ==) test.assert + (true string? false ==) test.assert + (false string? false ==) test.assert + (("a" 2 c) string? false ==) test.assert - ("a" integer? false ==) *test/assert - (1 integer?) *test/assert - (1.0 integer? false ==) *test/assert - (true integer? false ==) *test/assert - (false integer? false ==) *test/assert - (("a" 2 c) integer? false ==) *test/assert + ("a" integer? false ==) test.assert + (1 integer?) test.assert + (1.0 integer? false ==) test.assert + (true integer? false ==) test.assert + (false integer? false ==) test.assert + (("a" 2 c) integer? false ==) test.assert - ("a" float? false ==) *test/assert - (1 float? false ==) *test/assert - (1.0 float?) *test/assert - (true float? false ==) *test/assert - (false float? false ==) *test/assert - (("a" 2 c) float? false ==) *test/assert + ("a" float? false ==) test.assert + (1 float? false ==) test.assert + (1.0 float?) test.assert + (true float? false ==) test.assert + (false float? false ==) test.assert + (("a" 2 c) float? false ==) test.assert - ("a" boolean? false ==) *test/assert - (1 boolean? false ==) *test/assert - (1.0 boolean? false ==) *test/assert - (true boolean?) *test/assert - (false boolean?) *test/assert - (("a" 2 c) boolean? false ==) *test/assert + ("a" boolean? false ==) test.assert + (1 boolean? false ==) test.assert + (1.0 boolean? false ==) test.assert + (true boolean?) test.assert + (false boolean?) test.assert + (("a" 2 c) boolean? false ==) test.assert - ("a" number? false ==) *test/assert - (1 number?) *test/assert - (1.0 number?) *test/assert - (true number? false ==) *test/assert - (false number? false ==) *test/assert - (("a" 2 c) number? false ==) *test/assert + ("a" number? false ==) test.assert + (1 number?) test.assert + (1.0 number?) test.assert + (true number? false ==) test.assert + (false number? false ==) test.assert + (("a" 2 c) number? false ==) test.assert - ("a" quotation? false ==) *test/assert - (1 quotation? false ==) *test/assert - (1.0 quotation? false ==) *test/assert - (true quotation? false ==) *test/assert - (false quotation? false ==) *test/assert - (("a" 2 c) quotation?) *test/assert + ("a" quotation? false ==) test.assert + (1 quotation? false ==) test.assert + (1.0 quotation? false ==) test.assert + (true quotation? false ==) test.assert + (false quotation? false ==) test.assert + (("a" 2 c) quotation?) test.assert - ("a" stringlike?) *test/assert - (1 stringlike? false ==) *test/assert - ('test stringlike?) *test/assert + ("a" stringlike?) test.assert + (1 stringlike? false ==) test.assert + ('test stringlike?) test.assert - (("a") quoted-symbol? not) *test/assert - ('test quoted-symbol?) *test/assert - ((aaa bbb) quoted-symbol? not) *test/assert + (("a") quoted-symbol? not) test.assert + ('test quoted-symbol?) test.assert + ((aaa bbb) quoted-symbol? not) test.assert - ({} 'dict:module type? false ==) *test/assert - ((1 2 3) 'dict:module type? false ==) *test/assert - (4 'dict:module type? false ==) *test/assert - (logic 'dict:module type?) *test/assert - (1 "int" type?) *test/assert - ("test" "str" type?) *test/assert - (global "dict:module" type?) *test/assert + ({} 'dict:module type? false ==) test.assert + ((1 2 3) 'dict:module type? false ==) test.assert + (4 'dict:module type? false ==) test.assert + (logic 'dict:module type?) test.assert + (1 "int" type?) test.assert + ("test" "str" type?) test.assert + (global "dict:module" type?) test.assert - (7 0 / inf ==) *test/assert - (-7 0 / -inf ==) *test/assert - (0 0 / nan ==) *test/assert - (10 3 / 3.33333 ==) *test/assert + (7 0 / inf ==) test.assert + (-7 0 / -inf ==) test.assert + (0 0 / nan ==) test.assert + (10 3 / 3.33333 ==) test.assert - (3 "a" == not) *test/assert - (1 () != true) *test/assert - (3.3 'test == not) *test/assert + (3 "a" == not) test.assert + (1 () != true) test.assert + (3.3 'test == not) test.assert ( (

@@ -165,7 +165,7 @@ ("a" "b" ==)

("never printed" puts!) ) && false == - ) *test/assert + ) test.assert ( (

@@ -174,7 +174,7 @@ (2 1 <)

("a" "a" ==) ("never printed" puts!) ) || - ) *test/assert + ) test.assert - *test/report + test.report clear-stack
M tests/math.mintests/math.min

@@ -1,35 +1,35 @@

'min-test require :test ;;; -"math" *test/describe +"math" test.describe - (0 d2r sin 0 ==) *test/assert + (0 d2r sin 0 ==) test.assert - (30 d2r sin 0.5 ==) *test/assert + (30 d2r sin 0.5 ==) test.assert - (45 d2r sin 2 sqrt 2 / ==) *test/assert + (45 d2r sin 2 sqrt 2 / ==) test.assert - (60 d2r sin 3 sqrt 2 / ==) *test/assert + (60 d2r sin 3 sqrt 2 / ==) test.assert - (90 d2r sin 1 ==) *test/assert + (90 d2r sin 1 ==) test.assert - (15 d2r sin 75 d2r cos ==) *test/assert + (15 d2r sin 75 d2r cos ==) test.assert - (15 cos 2 pow 15 sin 2 pow + 1 ==) *test/assert + (15 cos 2 pow 15 sin 2 pow + 1 ==) test.assert - (pi 4 / tan 1 ==) *test/assert + (pi 4 / tan 1 ==) test.assert - (e 3 pow ln 3 ==) *test/assert + (e 3 pow ln 3 ==) test.assert - (pi floor 3 ==) *test/assert + (pi floor 3 ==) test.assert - (pi 2 round 3.14 ==) *test/assert + (pi 2 round 3.14 ==) test.assert - (pi ceil 4 ==) *test/assert + (pi ceil 4 ==) test.assert - (pi trunc 3 ==) *test/assert + (pi trunc 3 ==) test.assert - (-2.87 abs 2.87 ==) *test/assert + (-2.87 abs 2.87 ==) test.assert - *test/report + test.report clear-stack
M tests/net.mintests/net.min

@@ -1,7 +1,7 @@

'min-test require :test ;;; -"net" *test/describe +"net" test.describe {} socket :srv1 {} socket :srv2

@@ -25,12 +25,12 @@ cli1 recv-line @line

(response line) => "\n" join puts @response ) while - (response "200 OK" match?) *test/assert + (response "200 OK" match?) test.assert - (srv1 srv2 ==) *test/assert - (cli1 cli2 !=) *test/assert + (srv1 srv2 ==) test.assert + (cli1 cli2 !=) test.assert - *test/report + test.report clear-stack srv1 close srv2 close
M tests/num.mintests/num.min

@@ -1,88 +1,88 @@

'min-test require :test ;;; -"num" *test/describe +"num" test.describe - (2 2 + 4 ==) *test/assert - (1 3.0 + 4 ==) *test/assert - (3.1 3.9 + 7 ==) *test/assert - (3 -2.1 + 0.8999999999999999 ==) *test/assert + (2 2 + 4 ==) test.assert + (1 3.0 + 4 ==) test.assert + (3.1 3.9 + 7 ==) test.assert + (3 -2.1 + 0.8999999999999999 ==) test.assert - (3 3 - 0 ==) *test/assert - (-5 -4 - -1 ==) *test/assert - (-4 3.7 - -7.7 ==) *test/assert + (3 3 - 0 ==) test.assert + (-5 -4 - -1 ==) test.assert + (-4 3.7 - -7.7 ==) test.assert - (-2 4 * -8 ==) *test/assert - (-2.5 -2 * 5 ==) *test/assert - (3 3 * 9 ==) *test/assert + (-2 4 * -8 ==) test.assert + (-2.5 -2 * 5 ==) test.assert + (3 3 * 9 ==) test.assert - (5 2 / 2.5 ==) *test/assert - (1 3 / 0.3333333333333333 ==) *test/assert - (-3 2 / -1.5 ==) *test/assert + (5 2 / 2.5 ==) test.assert + (1 3 / 0.3333333333333333 ==) test.assert + (-3 2 / -1.5 ==) test.assert - (5 2 div 2 ==) *test/assert - (1 3 div 0 ==) *test/assert - (-3 2 div -1 ==) *test/assert + (5 2 div 2 ==) test.assert + (1 3 div 0 ==) test.assert + (-3 2 div -1 ==) test.assert - (5 2 mod 1 ==) *test/assert - (4 2 mod 0 ==) *test/assert - (-3 2 mod -1 ==) *test/assert + (5 2 mod 1 ==) test.assert + (4 2 mod 0 ==) test.assert + (-3 2 mod -1 ==) test.assert - (1000 random 1000 <) *test/assert + (1000 random 1000 <) test.assert - ((1 2 3 4 5) sum 15 ==) *test/assert + ((1 2 3 4 5) sum 15 ==) test.assert - ((1 2 3 4 5) product 120 ==) *test/assert + ((1 2 3 4 5) product 120 ==) test.assert - ((1 2 3 4 5) avg 3.0 ==) *test/assert - ((1 2 3 4 5 6) avg 3.5 ==) *test/assert + ((1 2 3 4 5) avg 3.0 ==) test.assert + ((1 2 3 4 5 6) avg 3.5 ==) test.assert - ((1 3 5 7) med 4.0 ==) *test/assert - ((1 3 5 7 9) med 5 ==) *test/assert + ((1 3 5 7) med 4.0 ==) test.assert + ((1 3 5 7 9) med 5 ==) test.assert - ((1 5) range (1 2 3 4 5) ==) *test/assert - ((5 1) range (5 4 3 2 1) ==) *test/assert - ((4 7) range (4 5 6 7) ==) *test/assert - ((7 4) range (7 6 5 4) ==) *test/assert - ((1 6 2) range (1 3 5) ==) *test/assert - ((1 6 3) range (1 4) ==) *test/assert - ((0 6 2) range (0 2 4 6) ==) *test/assert - ((6 1 2) range (6 4 2) ==) *test/assert - ((6 1 3) range (6 3) ==) *test/assert - ((6 0 2) range (6 4 2 0) ==) *test/assert + ((1 5) range (1 2 3 4 5) ==) test.assert + ((5 1) range (5 4 3 2 1) ==) test.assert + ((4 7) range (4 5 6 7) ==) test.assert + ((7 4) range (7 6 5 4) ==) test.assert + ((1 6 2) range (1 3 5) ==) test.assert + ((1 6 3) range (1 4) ==) test.assert + ((0 6 2) range (0 2 4 6) ==) test.assert + ((6 1 2) range (6 4 2) ==) test.assert + ((6 1 3) range (6 3) ==) test.assert + ((6 0 2) range (6 4 2 0) ==) test.assert - (2 3 bitand 2 ==) *test/assert + (2 3 bitand 2 ==) test.assert - (123 bitnot -124 ==) *test/assert + (123 bitnot -124 ==) test.assert - (2 3 bitor 3 ==) *test/assert + (2 3 bitor 3 ==) test.assert - (2 3 bitxor 1 ==) *test/assert + (2 3 bitxor 1 ==) test.assert - (2 3 shl 16 ==) *test/assert + (2 3 shl 16 ==) test.assert - (16 3 shr 2 ==) *test/assert + (16 3 shr 2 ==) test.assert (0 :c (c 10 <) (c succ @c) while - c 10 ==) *test/assert + c 10 ==) test.assert - ((1 2 3 4 5) (even?) filter (2 4) ==) *test/assert + ((1 2 3 4 5) (even?) filter (2 4) ==) test.assert - ((1 2 3 4 5) (even?) any?) *test/assert + ((1 2 3 4 5) (even?) any?) test.assert - ((2 4 6 8) (even?) all?) *test/assert + ((2 4 6 8) (even?) all?) test.assert - (base? "dec" ==) *test/assert - ('bin base "bin" base? == 'dec base) *test/assert - (0b10010 18 ==) *test/assert - (0b101010 0b010101 bitand 0b000000 ==) *test/assert - (0b101010 0b010101 bitor 0b111111 ==) *test/assert - (0b101010 0b010101 bitxor 0b111111 ==) *test/assert - (0b111000 (0 2) bitflip 0b111101 ==) *test/assert - (0b111001 (0) bitclear 0b111000 ==) *test/assert - (0b111000 (0 1) bitset 0b111011 ==) *test/assert - (0b111000 bitparity 1 ==) *test/assert + (base? "dec" ==) test.assert + ('bin base "bin" base? == 'dec base) test.assert + (0b10010 18 ==) test.assert + (0b101010 0b010101 bitand 0b000000 ==) test.assert + (0b101010 0b010101 bitor 0b111111 ==) test.assert + (0b101010 0b010101 bitxor 0b111111 ==) test.assert + (0b111000 (0 2) bitflip 0b111101 ==) test.assert + (0b111001 (0) bitclear 0b111000 ==) test.assert + (0b111000 (0 1) bitset 0b111011 ==) test.assert + (0b111000 bitparity 1 ==) test.assert - *test/report + test.report clear-stack
M tests/seq.mintests/seq.min

@@ -1,93 +1,93 @@

'min-test require :test ;;; -"seq" *test/describe +"seq" test.describe - ((1 2) (3 4) concat (1 2 3 4) ==) *test/assert + ((1 2) (3 4) concat (1 2 3 4) ==) test.assert - ((1 2 3) first 1 ==) *test/assert + ((1 2 3) first 1 ==) test.assert - ((1 2 3) last 3 ==) *test/assert + ((1 2 3) last 3 ==) test.assert - ((1 2 3) rest (2 3) ==) *test/assert + ((1 2 3) rest (2 3) ==) test.assert - (4 (1 2 3) append (1 2 3 4) ==) *test/assert + (4 (1 2 3) append (1 2 3 4) ==) test.assert - (0 (1 2 3) prepend (0 1 2 3) ==) *test/assert + (0 (1 2 3) prepend (0 1 2 3) ==) test.assert - ((1 2 3 4) 2 get 3 ==) *test/assert + ((1 2 3 4) 2 get 3 ==) test.assert - ((a b c) 1 get-raw /type "sym" ==) *test/assert + ((a b c) 1 get-raw /type "sym" ==) test.assert - ((1 2 3 4) 222 2 set (1 2 222 4) ==) *test/assert + ((1 2 3 4) 222 2 set (1 2 222 4) ==) test.assert - ((1 2 3) "test" 1 set-sym (1 test 3) ==) *test/assert + ((1 2 3) "test" 1 set-sym (1 test 3) ==) test.assert - ((1 2 3 4) 2 remove (1 2 4) ==) *test/assert + ((1 2 3 4) 2 remove (1 2 4) ==) test.assert - ((1 2 3 4) 333 2 insert (1 2 333 3 4) ==) *test/assert + ((1 2 3 4) 333 2 insert (1 2 333 3 4) ==) test.assert - ((1 2 3) size 3 ==) *test/assert + ((1 2 3) size 3 ==) test.assert - ((1 2 3 4) 5 in? false ==) *test/assert + ((1 2 3 4) 5 in? false ==) test.assert - ((1 2 3 4) 2 in?) *test/assert + ((1 2 3 4) 2 in?) test.assert - ((1 2 3 4) (2 +) map (3 4 5 6) ==) *test/assert + ((1 2 3 4) (2 +) map (3 4 5 6) ==) test.assert - ((5 4 3 2 1) reverse (1 2 3 4 5) ==) *test/assert + ((5 4 3 2 1) reverse (1 2 3 4 5) ==) test.assert - ((3 4 7 2 4 6 5 6) '> sort (2 3 4 4 5 6 6 7) ==) *test/assert + ((3 4 7 2 4 6 5 6) '> sort (2 3 4 4 5 6 6 7) ==) test.assert - ((3 4 7 2 4 6 5 6) '< sort (7 6 6 5 4 4 3 2) ==) *test/assert + ((3 4 7 2 4 6 5 6) '< sort (7 6 6 5 4 4 3 2) ==) test.assert - ((1 2 3 4 5) 3 shorten (1 2 3) ==) *test/assert + ((1 2 3 4 5) 3 shorten (1 2 3) ==) test.assert - ((1 2 3 4 5) 3 take (1 2 3) ==) *test/assert + ((1 2 3 4 5) 3 take (1 2 3) ==) test.assert - ((1 2 3 4 5) 6 take (1 2 3 4 5) ==) *test/assert + ((1 2 3 4 5) 6 take (1 2 3 4 5) ==) test.assert - ((1 2 3 4 5) 3 drop (4 5) ==) *test/assert + ((1 2 3 4 5) 3 drop (4 5) ==) test.assert - ((1 2 3 4 5) 6 drop () ==) *test/assert + ((1 2 3 4 5) 6 drop () ==) test.assert - ((1 2 3 4 5) (2 >) find 2 ==) *test/assert + ((1 2 3 4 5) (2 >) find 2 ==) test.assert - ((1 2 3 4 5) 1 (*) reduce 120 ==) *test/assert + ((1 2 3 4 5) 1 (*) reduce 120 ==) test.assert - ((1 3 5) (dup *) (+) map-reduce 35 ==) *test/assert + ((1 3 5) (dup *) (+) map-reduce 35 ==) test.assert - ((1 2 3 4 5 6) (odd?) partition get-stack ((1 3 5) (2 4 6)) ==) *test/assert + ((1 2 3 4 5 6) (odd?) partition get-stack ((1 3 5) (2 4 6)) ==) test.assert - ((1 2 3 4 5 6) (odd?) reject (2 4 6) ==) *test/assert + ((1 2 3 4 5 6) (odd?) reject (2 4 6) ==) test.assert - ((1 2 3 4 5 6) 2 4 slice (3 4 5) ==) *test/assert + ((1 2 3 4 5 6) 2 4 slice (3 4 5) ==) test.assert - ((2 3 () 4 (3 4) () () "test") harvest (2 3 4 (3 4) "test") ==) *test/assert + ((2 3 () 4 (3 4) () () "test") harvest (2 3 4 (3 4) "test") ==) test.assert - ((1 2 3 (4 5 6) 7 (8 9)) flatten (1 2 3 4 5 6 7 8 9) ==) *test/assert + ((1 2 3 (4 5 6) 7 (8 9)) flatten (1 2 3 4 5 6 7 8 9) ==) test.assert - ((2 3 + 4 *) quote-map ('+ ==) find 2 ==) *test/assert + ((2 3 + 4 *) quote-map ('+ ==) find 2 ==) test.assert - ((2 4 6 8) 'even? all?) *test/assert + ((2 4 6 8) 'even? all?) test.assert - ((2 4 3 6 8) 'even? all? not) *test/assert + ((2 4 3 6 8) 'even? all? not) test.assert - ((1 2 3 4) 'odd? one? not) *test/assert + ((1 2 3 4) 'odd? one? not) test.assert - ((1 2 4) 'odd? one?) *test/assert + ((1 2 4) 'odd? one?) test.assert - ((1 2 3 4) 'odd? any?) *test/assert + ((1 2 3 4) 'odd? any?) test.assert - ((2 4 6 8) 'odd? any? not) *test/assert + ((2 4 6 8) 'odd? any? not) test.assert - ((1 2 "test") ("test" "a" true 1) intersection (1 "test") ==) *test/assert + ((1 2 "test") ("test" "a" true 1) intersection (1 "test") ==) test.assert - ((1 2 "test") ("test" "a" true 1) union (true 1 "test" "a" 2) ==) *test/assert + ((1 2 "test") ("test" "a" true 1) union (true 1 "test" "a" 2) ==) test.assert - ((1 2 "test") ("test" "a" true 1) difference (2) ==) *test/assert + ((1 2 "test") ("test" "a" true 1) difference (2) ==) test.assert - ((1 2 "test") ("test" "a" true 1) symmetric-difference (true "a" 2) ==) *test/assert + ((1 2 "test") ("test" "a" true 1) symmetric-difference (true "a" 2) ==) test.assert - *test/report + test.report clear-stack
M tests/stack.mintests/stack.min

@@ -1,37 +1,37 @@

'min-test require :test ;;; -"stack" *test/describe +"stack" test.describe - (1 2 3 4 get-stack (1 2 3 4) ==) *test/assert + (1 2 3 4 get-stack (1 2 3 4) ==) test.assert - ((1 2 3) set-stack get-stack (1 2 3) ==) *test/assert + ((1 2 3) set-stack get-stack (1 2 3) ==) test.assert - (1 id 1 ==) *test/assert + (1 id 1 ==) test.assert - (2 pop get-stack () ==) *test/assert + (2 pop get-stack () ==) test.assert - (1 dup get-stack (1 1) ==) *test/assert + (1 dup get-stack (1 1) ==) test.assert - (3 2 (1 +) dip + 6 ==) *test/assert + (3 2 (1 +) dip + 6 ==) test.assert - (1 2 nip get-stack (2) ==) *test/assert + (1 2 nip get-stack (2) ==) test.assert - (1 2 4 '+ dip get-stack (3 4) ==) *test/assert + (1 2 4 '+ dip get-stack (3 4) ==) test.assert - (1 2 4 '+ keep get-stack (1 6 4) ==) *test/assert + (1 2 4 '+ keep get-stack (1 6 4) ==) test.assert - ((1) (2 swap append) sip concat (1 2 1) ==) *test/assert + ((1) (2 swap append) sip concat (1 2 1) ==) test.assert - (1 (2 3) cons (1 2 3) ==) *test/assert + (1 (2 3) cons (1 2 3) ==) test.assert - (1 2 over get-stack (1 2 1) ==) *test/assert + (1 2 over get-stack (1 2 1) ==) test.assert - (1 2 3 pick get-stack (1 2 3 1) ==) *test/assert + (1 2 3 pick get-stack (1 2 3 1) ==) test.assert - ((1 2 3) ('sum 'size) => cleave / 2 ==) *test/assert + ((1 2 3) ('sum 'size) => cleave / 2 ==) test.assert - ((1 2) (3 4) ((0 get) (1 get)) spread get-stack (1 4) ==) *test/assert + ((1 2) (3 4) ((0 get) (1 get)) spread get-stack (1 4) ==) test.assert - *test/report + test.report clear-stack
M tests/str.mintests/str.min

@@ -1,92 +1,92 @@

'min-test require :test ;;; -"str" *test/describe +"str" test.describe - ("$1 - $2 - $3" (1 true "test") interpolate "1 - true - test" ==) *test/assert + ("$1 - $2 - $3" (1 true "test") interpolate "1 - true - test" ==) test.assert - ("$1 + $2 = $3" (2 2 (2 2 +)) apply interpolate "2 + 2 = 4" ==) *test/assert + ("$1 + $2 = $3" (2 2 (2 2 +)) apply interpolate "2 + 2 = 4" ==) test.assert - (" test " strip "test" ==) *test/assert + (" test " strip "test" ==) test.assert - ("test" length 4 ==) *test/assert + ("test" length 4 ==) test.assert - ("a,b,c" "," split ("a" "b" "c") ==) *test/assert + ("a,b,c" "," split ("a" "b" "c") ==) test.assert - ("abc" "" split ("a" "b" "c") ==) *test/assert + ("abc" "" split ("a" "b" "c") ==) test.assert - ("This is a test" 5 2 substr "is" ==) *test/assert + ("This is a test" 5 2 substr "is" ==) test.assert - ("this" 2 3 substr "is" ==) *test/assert + ("this" 2 3 substr "is" ==) test.assert - ("This is a test" "is" indexof 2 ==) *test/assert + ("This is a test" "is" indexof 2 ==) test.assert - ("test #1" "[0-9]" search ("1") ==) *test/assert + ("test #1" "[0-9]" search ("1") ==) test.assert - ("a" ord 97 ==) *test/assert + ("a" ord 97 ==) test.assert - (97 chr "a" ==) *test/assert + (97 chr "a" ==) test.assert - ("This is test #1" "test #([0-9])" search ("test #1" "1") ==) *test/assert + ("This is test #1" "test #([0-9])" search ("test #1" "1") ==) test.assert - ("This is a random string" "random" match?) *test/assert + ("This is a random string" "random" match?) test.assert - ("something is not something else" "some" "any" replace "anything is not anything else" ==) *test/assert + ("something is not something else" "some" "any" replace "anything is not anything else" ==) test.assert - ("MiN is a concatenative programming language" "(?i)^min" search ("MiN") ==) *test/assert + ("MiN is a concatenative programming language" "(?i)^min" search ("MiN") ==) test.assert - ("This is a difficult test" "difficult" "simple" replace "This is a simple test" ==) *test/assert + ("This is a difficult test" "difficult" "simple" replace "This is a simple test" ==) test.assert - ("This is a DIFFICULT\n test" "(?mi)difficult" "simple" replace "This is a simple\n test" ==) *test/assert + ("This is a DIFFICULT\n test" "(?mi)difficult" "simple" replace "This is a simple\n test" ==) test.assert - ("This is again another test" "(again|still|yet)" (1 get :m "_$#_" (m) =%) replace-apply "This is _again_ another test" ==) *test/assert + ("This is again another test" "(again|still|yet)" (1 get :m "_$#_" (m) =%) replace-apply "This is _again_ another test" ==) test.assert - ("/api/items/test-1" "\\/api\\/items\\/(.+)" search 1 get "test-1" ==) *test/assert + ("/api/items/test-1" "\\/api\\/items\\/(.+)" search 1 get "test-1" ==) test.assert - ("this is a test" uppercase "THIS IS A TEST" ==) *test/assert + ("this is a test" uppercase "THIS IS A TEST" ==) test.assert - ("THIS IS A TEST" lowercase "this is a test" ==) *test/assert + ("THIS IS A TEST" lowercase "this is a test" ==) test.assert - ("test" capitalize "Test" ==) *test/assert + ("test" capitalize "Test" ==) test.assert - ("this is a test" titleize "This Is A Test" ==) *test/assert + ("this is a test" titleize "This Is A Test" ==) test.assert - ("+" 3 repeat "+++" ==) *test/assert + ("+" 3 repeat "+++" ==) test.assert - ("test" 4 indent " test" ==) *test/assert + ("test" 4 indent " test" ==) test.assert - ((1 3 "test") ", " join "1, 3, test" ==) *test/assert + ((1 3 "test") ", " join "1, 3, test" ==) test.assert - ("PWD: $pwd" ("pwd" .) =% ("PWD: " .) => "" join ==) *test/assert + ("PWD: $pwd" ("pwd" .) =% ("PWD: " .) => "" join ==) test.assert - ("1.2.3" from-semver {1 :major 2 :minor 3 :patch} ==) *test/assert + ("1.2.3" from-semver {1 :major 2 :minor 3 :patch} ==) test.assert - ({2 :major 25 :minor 300 :patch} to-semver "2.25.300" ==) *test/assert + ({2 :major 25 :minor 300 :patch} to-semver "2.25.300" ==) test.assert - ("2.3.6" semver-inc-major "3.0.0" ==) *test/assert + ("2.3.6" semver-inc-major "3.0.0" ==) test.assert - ("2.3.6" semver-inc-minor "2.4.0" ==) *test/assert + ("2.3.6" semver-inc-minor "2.4.0" ==) test.assert - ("2.3.6" semver-inc-patch "2.3.7" ==) *test/assert + ("2.3.6" semver-inc-patch "2.3.7" ==) test.assert - ("4.6.5" semver? true ==) *test/assert + ("4.6.5" semver? true ==) test.assert - ("4.6.5.3" semver? false ==) *test/assert + ("4.6.5.3" semver? false ==) test.assert - ("fix" "pre" prefix "prefix" ==) *test/assert + ("fix" "pre" prefix "prefix" ==) test.assert - ("suf" "fix" suffix "suffix" ==) *test/assert + ("suf" "fix" suffix "suffix" ==) test.assert - ("http://test.com?€%,,!{}" encode-url "http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" ==) *test/assert + ("http://test.com?€%,,!{}" encode-url "http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" ==) test.assert - ("http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" decode-url "http://test.com?€%,,!{}" ==) *test/assert + ("http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" decode-url "http://test.com?€%,,!{}" ==) test.assert - ("http://h3rald.com/a/b/c?test=1#123" parse-url {"123" :anchor "h3rald.com" :hostname "" :password "/a/b/c" :path "" :port "test=1" :query "http" :scheme "" :username} ==) *test/assert + ("http://h3rald.com/a/b/c?test=1#123" parse-url {"123" :anchor "h3rald.com" :hostname "" :password "/a/b/c" :path "" :port "test=1" :query "http" :scheme "" :username} ==) test.assert - ("0b00101101" dup from-bin to-bin ==) *test/assert - ("0x00FF0000" dup from-hex to-hex ==) *test/assert - ("0o00007473" dup from-oct to-oct ==) *test/assert - ("123" dup from-dec to-dec ==) *test/assert + ("0b00101101" dup from-bin to-bin ==) test.assert + ("0x00FF0000" dup from-hex to-hex ==) test.assert + ("0o00007473" dup from-oct to-oct ==) test.assert + ("123" dup from-dec to-dec ==) test.assert - *test/report + test.report clear-stack
M tests/sys.mintests/sys.min

@@ -1,70 +1,70 @@

'min-test require :test ;;; -"sys" *test/describe +"sys" test.describe - ("dir1" mkdir "dir1" dir?) *test/assert + ("dir1" mkdir "dir1" dir?) test.assert - ("dir1" "dir2" mv "dir2" dir?) *test/assert + ("dir1" "dir2" mv "dir2" dir?) test.assert - ("dir1" dir? false ==) *test/assert + ("dir1" dir? false ==) test.assert - ("dir2" "dir1" cp "dir1" dir?) *test/assert + ("dir2" "dir1" cp "dir1" dir?) test.assert - ("..." "dir1/test.txt" fwrite "dir1/test.txt" file?) *test/assert + ("..." "dir1/test.txt" fwrite "dir1/test.txt" file?) test.assert - ("dir1/test.txt" "dir2" mv "dir2/test.txt" file?) *test/assert + ("dir1/test.txt" "dir2" mv "dir2/test.txt" file?) test.assert - ("dir1/test.txt" file? false ==) *test/assert + ("dir1/test.txt" file? false ==) test.assert - ("dir2/test.txt" "dir1" cp "dir1/test.txt" file?) *test/assert + ("dir2/test.txt" "dir1" cp "dir1/test.txt" file?) test.assert - ('dir1 ls 'filename map ("test.txt") ==) *test/assert + ('dir1 ls 'filename map ("test.txt") ==) test.assert - ('dir2 ls 'dirname map ("dir2") ==) *test/assert + ('dir2 ls 'dirname map ("dir2") ==) test.assert - ('dir1 rmdir 'dir2 rmdir 'dir1 dir? 'dir2 dir? or false ==) *test/assert + ('dir1 rmdir 'dir2 rmdir 'dir1 dir? 'dir2 dir? or false ==) test.assert - ("systest" mkdir . ls (. "systest") => "/" join in?) *test/assert + ("systest" mkdir . ls (. "systest") => "/" join in?) test.assert - ("systest" cd . "systest" match?) *test/assert + ("systest" cd . "systest" match?) test.assert .. cd - ("./min -v" & 'output dget "\." match?) *test/assert + ("./min -v" & 'output dget "\\." match?) test.assert - ("PATH" env?) *test/assert + ("PATH" env?) test.assert - ($PATH length 0 >) *test/assert + ($PATH length 0 >) test.assert - ("TEST" "AAA" put-env $AAA "TEST" ==) *test/assert + ("TEST" "AAA" put-env $AAA "TEST" ==) test.assert - (os length 0 >) *test/assert + (os length 0 >) test.assert - (cpu length 0 >) *test/assert + (cpu length 0 >) test.assert - ("TEST" "test.txt" fwrite "test.txt" file?) *test/assert + ("TEST" "test.txt" fwrite "test.txt" file?) test.assert - ("test.txt" "test2.txt" cp "test2.txt" file?) *test/assert + ("test.txt" "test2.txt" cp "test2.txt" file?) test.assert - ("test.txt" "test1.txt" mv "test1.txt" file?) *test/assert + ("test.txt" "test1.txt" mv "test1.txt" file?) test.assert - ("test2.txt" rm "test1.txt" rm . ls (. "test1.txt") => "/" join in? :t1 . ls "test2" in? t1 and false ==) *test/assert + ("test2.txt" rm "test1.txt" rm . ls (. "test1.txt") => "/" join in? :t1 . ls "test2" in? t1 and false ==) test.assert ("systest" cd "TEST" "test.txt" fwrite "TEST1" "test1.txt" fwrite "TEST2" "test2.txt" fwrite "TEST3" "test3.txt" fwrite - . ls "test.zip" zip . ls (. "test.zip") => "/" join in?) *test/assert + . ls "test.zip" zip . ls (. "test.zip") => "/" join in?) test.assert - ("test.zip" "extracted" unzip "extracted" ls "extracted/test1.txt" in?) *test/assert + ("test.zip" "extracted" unzip "extracted" ls "extracted/test1.txt" in?) test.assert .. cd - ("systest" rmdir . ls (. "systest") => "/" join in? false ==) *test/assert + ("systest" rmdir . ls (. "systest") => "/" join in? false ==) test.assert - ([ls] &ls /output ==) *test/assert + ([ls] &ls /output ==) test.assert - *test/report + test.report clear-stack "systest" rmdir
M tests/time.mintests/time.min

@@ -1,21 +1,21 @@

'min-test require :test ;;; -"time" *test/describe +"time" test.describe - (timestamp 1464951736 >) *test/assert + (timestamp 1464951736 >) test.assert - (now 1464951736 >) *test/assert + (now 1464951736 >) test.assert - (1464951736 datetime "2016-06-03T11:02:16Z" ==) *test/assert + (1464951736 datetime "2016-06-03T11:02:16Z" ==) test.assert - (1464951736 "yy-MM-dd" tformat "16-06-03" ==) *test/assert + (1464951736 "yy-MM-dd" tformat "16-06-03" ==) test.assert - (1464951736 timeinfo to-timestamp 1464951736 ==) *test/assert + (1464951736 timeinfo to-timestamp 1464951736 ==) test.assert - (1464951736 timeinfo 'second dget 16 ==) *test/assert + (1464951736 timeinfo 'second dget 16 ==) test.assert - (1464951736 timeinfo 'timezone dget integer?) *test/assert + (1464951736 timeinfo 'timezone dget integer?) test.assert - *test/report + test.report clear-stack
M tests/xml.mintests/xml.min

@@ -2,17 +2,17 @@ 'min-test require :test

;;; -"xml" *test/describe +"xml" test.describe - ("test" xentity /text "test" ==) *test/assert + ("test" xentity /text "test" ==) test.assert - ("test" xcomment /text "test" ==) *test/assert + ("test" xcomment /text "test" ==) test.assert - ("test" xtext /text "test" ==) *test/assert + ("test" xtext /text "test" ==) test.assert - ("test" xcdata /text "test" ==) *test/assert + ("test" xcdata /text "test" ==) test.assert - ("test" xelement /tag "test" ==) *test/assert + ("test" xelement /tag "test" ==) test.assert ( "test" xelement :xnode

@@ -21,32 +21,32 @@ "a1" xelement :child

"text..." xtext :text xnode (child text) => %children @xnode xnode to-xml - "<test attr1=\"a\"><a1 />text...</test>" == ) *test/assert + "<test attr1=\"a\"><a1 />text...</test>" == ) test.assert ( "<ul><li class='test'>yes</li><li class='test'>...</li><li>no</li></ul>" from-xml :xnode xnode "li.test" xquery /children first /text "yes" == - ) *test/assert + ) test.assert ( "<ul><li class='test'>yes</li><li class='test'>...</li><li>no</li></ul>" from-xml :xnode xnode "li.test" xqueryall size 2 == - ) *test/assert + ) test.assert ( "<b>this is a test</b><img src='test.jpg'><i>&copy</i>" from-html :xnode xnode to-xml "<document>\n <b>this is a test</b>\n <img src=\"test.jpg\" />\n <i>&amp;copy</i>\n</document>" == - ) *test/assert + ) test.assert ( "&gt;" xentity xentity2utf8 ">" == - ) *test/assert + ) test.assert ( "This is a <i>test</i>" xescape "This is a &lt;i&gt;test&lt;/i&gt;" == - ) *test/assert + ) test.assert - *test/report + test.report clear-stack