tests/seq.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 38 39 40 41 42 43 44 45 |
'test load 'test import "seq" describe ((1 2) (3 4) concat (1 2 3 4) ==) assert ((1 2 3) first 1 ==) assert ((1 2 3) rest (2 3) ==) assert (4 (1 2 3) append (1 2 3 4) ==) assert (0 (1 2 3) prepend (0 1 2 3) ==) assert ((1 2 3 4) 2 at 3 ==) assert ((1 2 3) size 3 ==) assert ((1 2 3 4) 5 in? false ==) assert ((1 2 3 4) 2 in?) assert ((1 2 3 4) (2 +) map (3 4 5 6) ==) assert ((5 4 3 2 1) reverse (1 2 3 4 5) ==) assert (((a 1)(b 2)(c 3)) dictionary?) assert (((a 1)(b 2)(c 3)) 'b dget 2 ==) assert (((a 1)(b 2)(c 3)) ' :dict dict 5 'b dset 7 %d =newdict newdict ((a 1)(b 5)(c 3)(d 7)) == dict ((a 1)(b 2)(c 3)) == and) assert (((a 1)(b 2)(c 3)) ' :dict dict 'b ddel =newdict newdict ((a 1)(c 3)) == dict ((a 1)(b 2)(c 3)) == and) assert (((a 1)(b 2)(c 3)) keys (a b c) ==) assert (((a 1)(b 2)(c 3)) values (1 2 3) ==) assert ((3 4 7 2 4 6 5 6) '> sort (2 3 4 4 5 6 6 7) ==) assert ((3 4 7 2 4 6 5 6) '< sort (7 6 6 5 4 4 3 2) ==) assert ((1 2 3 4 5) 3 shorten (1 2 3) ==) assert report newstack |