|
1 | | -: include "everything.fbl" |
| 1 | +: include "core.fbl" |
| 2 | +: include "tools.fbl" |
2 | 3 | : include "testing.fbl" |
3 | 4 |
|
4 | 5 |
|
|
25 | 26 | : (set "main" [ args ] |
26 | 27 | : test "functions" ([ --- ] |
27 | 28 | : describe "context_parent" ([ --- ] |
28 | | - : assert_equals (42) (context_parent 42) "should return the input" |
29 | | - : assert_equals ("foo") (context_parent "foo") "should return the input" |
30 | | - : assert_equals (test) (context_parent test) "should return the input" |
| 29 | + : assert_equals (42) (context_parent 42) "return integer (42)" |
| 30 | + : assert_equals ("foo") (context_parent "foo") "return string (foo)" |
| 31 | + : assert_equals (test) (context_parent test) "return function(test)" |
31 | 32 | : |
32 | | - : assert_equals (void) (context_parent_global 42) "should NOT return the input" |
33 | | - : assert_equals (void) (context_parent_global "foo") "should NOT return the input" |
34 | | - : assert_equals (void) (context_parent_global test) "should NOT return the input" |
| 33 | + : assert_equals (void) (context_parent_global 42) "return void (ignore integer (42))" |
| 34 | + : assert_equals (void) (context_parent_global "foo") "return void (ignore string (foo))" |
| 35 | + : assert_equals (void) (context_parent_global test) "return void (ignore function(test))" |
35 | 36 | ) |
36 | 37 | : describe "factorial" ([ --- ] |
37 | 38 | : assert_equals (1) (factorial 0) "0! == 1" |
|
51 | 52 | : assert_equals 3 (% 17 7) "17 % 7 == 3" |
52 | 53 | ) |
53 | 54 | : describe "convertion" ([ --- ] |
54 | | - : assert_equals 10 (int "10") "should convert string to integer" |
55 | | - : assert_equals 10 (int "10.5") "should convert string with trailing symbols to integer" |
56 | | - : assert_equals 10 (int 10.5) "should convert decimal numbers to integers" |
57 | | - ` TODO: Add '.' as a separator |
58 | | - ` : assert_equals 10.5 (number "10.5") "should convert string to decimal number" |
59 | | - : assert_equals "1" (string 1) "should convert numbers to string" |
| 55 | + : assert_equals 10 (int "10") "convert string to integer" |
| 56 | + : assert_equals 10 (int "10.5") "convert string with trailing symbols to integer" |
| 57 | + : assert_equals 10 (int 10.5) "convert decimal numbers to integers" |
| 58 | + : assert_equals 10.5 (number "10.5") "convert string to decimal number" |
| 59 | + : assert_equals "1" (string 1) "convert numbers to string" |
60 | 60 | ) |
61 | 61 | ) |
62 | 62 | : test "std" ([ --- ] |
|
0 commit comments