-
Notifications
You must be signed in to change notification settings - Fork 2
/
tests.maeel
40 lines (35 loc) · 1.95 KB
/
tests.maeel
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
include "maeel"
fun test value supposed message (
message " " + dup dup
30 swap len -: padding
puts "." padding * puts
value supposed =
(": SUCCESS" putsln)
(": FAIL -- " puts value putsln)
ifelse
)
3 2 + 5 "add" test
3 2 - 1 "sub" test
3 2 * 6 "mul" test
6 2 / 3 "div" test
2 3 drop 2 "drop" test
2 3 dup take3 2 3 3 take3 "dup" test
1 2 3 rot take3 3 1 2 take3 "rot" test
2 3 over take3 2 3 2 take3 "over" test
1 2 3 swap take3 1 3 2 take3 "swap" test
3 2 + 2 3 + "add commutativity" test
3 2 * 2 3 * "mul commutativity" test
true bool_to_string "true" "bool_to_string 1" test
false bool_to_string "false" "bool_to_string 2" test
true true and bool_to_string "true" "and 1" test
true false and bool_to_string "false" "and 2" test
false true and bool_to_string "false" "and 3" test
false false and bool_to_string "false" "and 4" test
true true or bool_to_string "true" "or 1" test
true false or bool_to_string "true" "or 2" test
false true or bool_to_string "true" "or 3" test
false false or bool_to_string "false" "or 4" test
List 1 2 3 end list 1+ 2+ 3+ "list 1" test
List 1 end list 1+ "list 2" test
List end list "list 3" test
1 5 range List 1 2 3 4 end "list 4" test