gloo 6.4.0 → 6.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/docs/application.md +9 -0
  3. data/docs/language_objects.md +40 -0
  4. data/docs/objects.md +1 -1
  5. data/docs/verbs.md +9 -0
  6. data/lib/VERSION +1 -1
  7. data/lib/VERSION_NOTES +11 -0
  8. data/lib/gloo/app/engine.rb +5 -1
  9. data/lib/gloo/app/log.rb +5 -5
  10. data/lib/gloo/app/settings.rb +4 -1
  11. data/lib/gloo/core/obj.rb +21 -1
  12. data/lib/gloo/persist/file_loader.rb +7 -0
  13. data/lib/gloo/persist/persist_man.rb +35 -3
  14. data/lib/gloo/persist/source/obj_node.rb +41 -0
  15. data/lib/gloo/verbs/list.rb +24 -2
  16. data/lib/gloo/verbs/load.rb +13 -2
  17. data/test.gloo/ctrl/each.test.gloo +28 -30
  18. data/test.gloo/dt/date.test.gloo +69 -71
  19. data/test.gloo/dt/datetime.test.gloo +55 -57
  20. data/test.gloo/dt/time.test.gloo +70 -72
  21. data/test.gloo/lang/continuation.test.gloo +25 -27
  22. data/test.gloo/lang/convert.test.gloo +50 -52
  23. data/test.gloo/lang/dt_comparisons.test.gloo +87 -89
  24. data/test.gloo/lang/exceptions.test.gloo +42 -44
  25. data/test.gloo/lang/gloo_sys.test.gloo +100 -102
  26. data/test.gloo/lang/here.test.gloo +32 -34
  27. data/test.gloo/lang/it.test.gloo +27 -29
  28. data/test.gloo/lang/literal.test.gloo +55 -57
  29. data/test.gloo/lang/load_lib_directive.test.gloo +18 -20
  30. data/test.gloo/lang/naming.test.gloo +28 -30
  31. data/test.gloo/lang/ops.test.gloo +53 -55
  32. data/test.gloo/lang/shorthand.test.gloo +15 -17
  33. data/test.gloo/math/add.test.gloo +40 -42
  34. data/test.gloo/math/div.test.gloo +23 -25
  35. data/test.gloo/math/mult.test.gloo +23 -25
  36. data/test.gloo/math/sub.test.gloo +23 -25
  37. data/test.gloo/objs/alias.test.gloo +15 -17
  38. data/test.gloo/objs/bool.test.gloo +54 -56
  39. data/test.gloo/objs/can.test.gloo +33 -35
  40. data/test.gloo/objs/cipher.test.gloo +39 -41
  41. data/test.gloo/objs/decimal.test.gloo +27 -29
  42. data/test.gloo/objs/erb.test.gloo +47 -49
  43. data/test.gloo/objs/file.test.gloo +68 -70
  44. data/test.gloo/objs/function.test.gloo +37 -39
  45. data/test.gloo/objs/int.test.gloo +54 -56
  46. data/test.gloo/objs/json.test.gloo +56 -58
  47. data/test.gloo/objs/obj.test.gloo +68 -48
  48. data/test.gloo/objs/outline.test.gloo +48 -50
  49. data/test.gloo/objs/password.test.gloo +34 -36
  50. data/test.gloo/objs/repeat.test.gloo +42 -44
  51. data/test.gloo/objs/script.test.gloo +13 -15
  52. data/test.gloo/objs/string.test.gloo +82 -84
  53. data/test.gloo/objs/text.test.gloo +90 -92
  54. data/test.gloo/objs/untyped.test.gloo +36 -38
  55. data/test.gloo/objs/uri.test.gloo +37 -39
  56. data/test.gloo/verbs/break.test.gloo +12 -14
  57. data/test.gloo/verbs/check.test.gloo +22 -24
  58. data/test.gloo/verbs/context.test.gloo +11 -13
  59. data/test.gloo/verbs/create.test.gloo +7 -9
  60. data/test.gloo/verbs/eval.test.gloo +10 -12
  61. data/test.gloo/verbs/exists.test.gloo +43 -45
  62. data/test.gloo/verbs/if.test.gloo +8 -10
  63. data/test.gloo/verbs/invoke.test.gloo +73 -75
  64. data/test.gloo/verbs/list.test.gloo +21 -23
  65. data/test.gloo/verbs/load.test.gloo +27 -21
  66. data/test.gloo/verbs/log.test.gloo +7 -9
  67. data/test.gloo/verbs/move.test.gloo +12 -14
  68. data/test.gloo/verbs/put.test.gloo +10 -12
  69. data/test.gloo/verbs/reload.test.gloo +30 -32
  70. data/test.gloo/verbs/run.test.gloo +8 -10
  71. data/test.gloo/verbs/save.test.gloo +90 -94
  72. data/test.gloo/verbs/show.test.gloo +26 -28
  73. data/test.gloo/verbs/tell.test.gloo +8 -10
  74. data/test.gloo/verbs/throw.test.gloo +31 -33
  75. data/test.gloo/verbs/unless.test.gloo +13 -15
  76. data/test.gloo/verbs/unload.test.gloo +10 -12
  77. metadata +1 -1
@@ -4,38 +4,36 @@
4
4
  # 'it' holds the result of the last statement that produced one.
5
5
  #
6
6
 
7
- tests [can] :
8
- lang [can] :
9
- it [can] :
7
+ tests.lang.it [can] :
10
8
 
11
- n [int] : 5
12
- r [string] :
9
+ n [int] : 5
10
+ r [string] :
13
11
 
14
- set_by_the_previous_statement [test] :
15
- description [string] : show, eval, tell and put all leave their result in it.
16
- on_test [script] :
17
- show 3 + 4
18
- eval it = 7
19
- assert "expected show to leave the evaluated value in it"
12
+ set_by_the_previous_statement [test] :
13
+ description [string] : show, eval, tell and put all leave their result in it.
14
+ on_test [script] :
15
+ show 3 + 4
16
+ eval it = 7
17
+ assert "expected show to leave the evaluated value in it"
20
18
 
21
- eval 10 * 2
22
- eval it = 20
23
- assert "expected eval to leave its result in it"
19
+ eval 10 * 2
20
+ eval it = 20
21
+ assert "expected eval to leave its result in it"
24
22
 
25
- put 'hello' into ^^.r
26
- eval it = 'hello'
27
- assert "expected put to leave the stored value in it"
23
+ put 'hello' into ^^.r
24
+ eval it = 'hello'
25
+ assert "expected put to leave the stored value in it"
28
26
 
29
- put 5 into ^^.n
30
- tell ^^.n to inc
31
- eval it = 6
32
- assert "expected tell to leave the message result in it"
27
+ put 5 into ^^.n
28
+ tell ^^.n to inc
29
+ eval it = 6
30
+ assert "expected tell to leave the message result in it"
33
31
 
34
- persists_across_statements_that_produce_nothing [test] :
35
- description [string] : statements like a bare show or list leave it untouched.
36
- on_test [script] :
37
- eval 42
38
- show
39
- list ^^.n
40
- eval it = 42
41
- assert "expected it to survive statements that don't produce a result"
32
+ persists_across_statements_that_produce_nothing [test] :
33
+ description [string] : statements like a bare show or list leave it untouched.
34
+ on_test [script] :
35
+ eval 42
36
+ show
37
+ list ^^.n
38
+ eval it = 42
39
+ assert "expected it to survive statements that don't produce a result"
@@ -2,60 +2,58 @@
2
2
  # Literal value tests
3
3
  #
4
4
 
5
- tests [can] :
6
- lang [can] :
7
- literal [can] :
8
-
9
- s [string] :
10
- i [integer] :
11
- d [decimal] :
12
- b [boolean] :
13
-
14
- string_quote_styles [test] :
15
- description [string] : single and double quotes both make a string; the other quote can appear inside.
16
- on_test [script] :
17
- put 'single quoted' into ^^.s
18
- eval ^^.s = 'single quoted'
19
- assert "expected single quotes to work"
20
-
21
- put "double quoted" into ^^.s
22
- eval ^^.s = 'double quoted'
23
- assert "expected double quotes to work"
24
-
25
- put "you're fine" into ^^.s
26
- eval ^^.s = "you're fine"
27
- assert "expected an apostrophe inside double quotes to be literal"
28
-
29
- number_literals [test] :
30
- description [string] : integer and decimal literals, including negatives.
31
- on_test [script] :
32
- put -5 into ^^.i
33
- eval ^^.i = -5
34
- assert "expected a negative integer literal"
35
-
36
- put 3.14159 into ^^.d
37
- eval ^^.d = 3.14159
38
- assert "expected a decimal literal"
39
-
40
- put -2.5 into ^^.d
41
- eval ^^.d = -2.5
42
- assert "expected a negative decimal literal"
43
-
44
- boolean_literals_are_case_insensitive [test] :
45
- description [string] : TRUE, true, False, FALSE all parse.
46
- on_test [script] :
47
- put TRUE into ^^.b
48
- eval ^^.b = true
49
- assert "expected TRUE to parse"
50
-
51
- put true into ^^.b
52
- eval ^^.b = true
53
- assert "expected true to parse"
54
-
55
- put False into ^^.b
56
- eval ^^.b = false
57
- assert "expected False to parse"
58
-
59
- put FALSE into ^^.b
60
- eval ^^.b = false
61
- assert "expected FALSE to parse"
5
+ tests.lang.literal [can] :
6
+
7
+ s [string] :
8
+ i [integer] :
9
+ d [decimal] :
10
+ b [boolean] :
11
+
12
+ string_quote_styles [test] :
13
+ description [string] : single and double quotes both make a string; the other quote can appear inside.
14
+ on_test [script] :
15
+ put 'single quoted' into ^^.s
16
+ eval ^^.s = 'single quoted'
17
+ assert "expected single quotes to work"
18
+
19
+ put "double quoted" into ^^.s
20
+ eval ^^.s = 'double quoted'
21
+ assert "expected double quotes to work"
22
+
23
+ put "you're fine" into ^^.s
24
+ eval ^^.s = "you're fine"
25
+ assert "expected an apostrophe inside double quotes to be literal"
26
+
27
+ number_literals [test] :
28
+ description [string] : integer and decimal literals, including negatives.
29
+ on_test [script] :
30
+ put -5 into ^^.i
31
+ eval ^^.i = -5
32
+ assert "expected a negative integer literal"
33
+
34
+ put 3.14159 into ^^.d
35
+ eval ^^.d = 3.14159
36
+ assert "expected a decimal literal"
37
+
38
+ put -2.5 into ^^.d
39
+ eval ^^.d = -2.5
40
+ assert "expected a negative decimal literal"
41
+
42
+ boolean_literals_are_case_insensitive [test] :
43
+ description [string] : TRUE, true, False, FALSE all parse.
44
+ on_test [script] :
45
+ put TRUE into ^^.b
46
+ eval ^^.b = true
47
+ assert "expected TRUE to parse"
48
+
49
+ put true into ^^.b
50
+ eval ^^.b = true
51
+ assert "expected true to parse"
52
+
53
+ put False into ^^.b
54
+ eval ^^.b = false
55
+ assert "expected False to parse"
56
+
57
+ put FALSE into ^^.b
58
+ eval ^^.b = false
59
+ assert "expected FALSE to parse"
@@ -6,28 +6,26 @@
6
6
  #
7
7
  load lib yaml
8
8
 
9
- tests [can] :
10
- lang [can] :
11
- load_lib_directive [can] :
9
+ tests.lang.load_lib_directive [can] :
12
10
 
13
- # this declaration only parses because 'load lib yaml' above
14
- # registered the type before the loader got here
15
- cfg [yaml] :
11
+ # this declaration only parses because 'load lib yaml' above
12
+ # registered the type before the loader got here
13
+ cfg [yaml] :
16
14
 
17
- library_type_is_available [test] :
18
- description [string] : a load lib directive at the top of the file registers the library's types.
19
- on_test [script] :
20
- exists? object yaml
21
- assert "expected the yaml type to be registered by the directive"
15
+ library_type_is_available [test] :
16
+ description [string] : a load lib directive at the top of the file registers the library's types.
17
+ on_test [script] :
18
+ exists? object yaml
19
+ assert "expected the yaml type to be registered by the directive"
22
20
 
23
- exists? object yml
24
- assert "expected the yaml short name to be registered too"
21
+ exists? object yml
22
+ assert "expected the yaml short name to be registered too"
25
23
 
26
- typed_object_was_created [test] :
27
- description [string] : an object of the library's type declared in the same file exists.
28
- on_test [script] :
29
- exists? instance tests.lang.load_lib_directive.cfg
30
- assert "expected the [yaml] object to have been created during load"
24
+ typed_object_was_created [test] :
25
+ description [string] : an object of the library's type declared in the same file exists.
26
+ on_test [script] :
27
+ exists? instance tests.lang.load_lib_directive.cfg
28
+ assert "expected the [yaml] object to have been created during load"
31
29
 
32
- check tests.lang.load_lib_directive.cfg for responds_to? ( 'load' )
33
- assert "expected it to be a real yaml object that responds to load"
30
+ check tests.lang.load_lib_directive.cfg for responds_to? ( 'load' )
31
+ assert "expected it to be a real yaml object that responds to load"
@@ -2,43 +2,41 @@
2
2
  # Object naming tests
3
3
  #
4
4
 
5
- tests [can] :
6
- lang [can] :
7
- naming [can] :
5
+ tests.lang.naming [can] :
8
6
 
9
- dup [string] : first
10
- dup [string] : second
7
+ dup [string] : first
8
+ dup [string] : second
11
9
 
12
- Alpha [string] : mixed case
10
+ Alpha [string] : mixed case
13
11
 
14
- 1 [string] : numeric name
12
+ 1 [string] : numeric name
15
13
 
16
- string [string] : a type keyword as a name
17
- put [string] : a verb keyword as a name
14
+ string [string] : a type keyword as a name
15
+ put [string] : a verb keyword as a name
18
16
 
19
- first_of_a_duplicate_name_wins [test] :
20
- description [string] : when two siblings share a name, the path always reaches the first.
21
- on_test [script] :
22
- eval ^^.dup = 'first'
23
- assert "expected the first 'dup' to be the one reached"
17
+ first_of_a_duplicate_name_wins [test] :
18
+ description [string] : when two siblings share a name, the path always reaches the first.
19
+ on_test [script] :
20
+ eval ^^.dup = 'first'
21
+ assert "expected the first 'dup' to be the one reached"
24
22
 
25
- path_lookup_is_case_insensitive [test] :
26
- description [string] : a pathname segment matches a name regardless of case.
27
- on_test [script] :
28
- eval tests.lang.naming.alpha = 'mixed case'
29
- assert "expected lower-case lookup to find 'Alpha'"
23
+ path_lookup_is_case_insensitive [test] :
24
+ description [string] : a pathname segment matches a name regardless of case.
25
+ on_test [script] :
26
+ eval tests.lang.naming.alpha = 'mixed case'
27
+ assert "expected lower-case lookup to find 'Alpha'"
30
28
 
31
- eval tests.lang.naming.ALPHA = 'mixed case'
32
- assert "expected upper-case lookup to find 'Alpha'"
29
+ eval tests.lang.naming.ALPHA = 'mixed case'
30
+ assert "expected upper-case lookup to find 'Alpha'"
33
31
 
34
- numeric_and_keyword_names [test] :
35
- description [string] : digits and reserved-looking words are valid object names.
36
- on_test [script] :
37
- eval tests.lang.naming.1 = 'numeric name'
38
- assert "expected a numeric name to work"
32
+ numeric_and_keyword_names [test] :
33
+ description [string] : digits and reserved-looking words are valid object names.
34
+ on_test [script] :
35
+ eval tests.lang.naming.1 = 'numeric name'
36
+ assert "expected a numeric name to work"
39
37
 
40
- eval ^^.string = 'a type keyword as a name'
41
- assert "expected a type keyword to be usable as a name"
38
+ eval ^^.string = 'a type keyword as a name'
39
+ assert "expected a type keyword to be usable as a name"
42
40
 
43
- eval ^^.put = 'a verb keyword as a name'
44
- assert "expected a verb keyword to be usable as a name"
41
+ eval ^^.put = 'a verb keyword as a name'
42
+ assert "expected a verb keyword to be usable as a name"
@@ -2,78 +2,76 @@
2
2
  # Gloo System tests
3
3
  #
4
4
 
5
- tests [can] :
6
- lang [can] :
7
- ops [can] :
5
+ tests.lang.ops [can] :
8
6
 
9
- confirm_eq_ops [test] :
10
- description [string] : Confirm equality operations.
11
- on_test [script] :
12
- eval 1 = 1
13
- assert "expected 1 = 1"
7
+ confirm_eq_ops [test] :
8
+ description [string] : Confirm equality operations.
9
+ on_test [script] :
10
+ eval 1 = 1
11
+ assert "expected 1 = 1"
14
12
 
15
- eval 2 = 3
16
- refute "expected 2 to not equal 3"
13
+ eval 2 = 3
14
+ refute "expected 2 to not equal 3"
17
15
 
18
- eval "hello" = "hello"
19
- assert "expected 'hello' = 'hello'"
16
+ eval "hello" = "hello"
17
+ assert "expected 'hello' = 'hello'"
20
18
 
21
- eval "hello" = "world"
22
- refute "expected 'hello' to not equal 'world'"
19
+ eval "hello" = "world"
20
+ refute "expected 'hello' to not equal 'world'"
23
21
 
24
- confirm_not_eq_ops [test] :
25
- description [string] : Confirm not equal operations.
26
- on_test [script] :
27
- eval 1 != 2
28
- assert "expected 1 != 2"
22
+ confirm_not_eq_ops [test] :
23
+ description [string] : Confirm not equal operations.
24
+ on_test [script] :
25
+ eval 1 != 2
26
+ assert "expected 1 != 2"
29
27
 
30
- eval 1 != 1
31
- refute "expected 1 to not equal 1"
28
+ eval 1 != 1
29
+ refute "expected 1 to not equal 1"
32
30
 
33
- eval "hello" != "world"
34
- assert "expected 'hello' != 'world'"
31
+ eval "hello" != "world"
32
+ assert "expected 'hello' != 'world'"
35
33
 
36
- eval "hello" != "hello"
37
- refute "expected 'hello' to not equal 'hello'"
34
+ eval "hello" != "hello"
35
+ refute "expected 'hello' to not equal 'hello'"
38
36
 
39
- confirm_gt_ops [test] :
40
- description [string] : Confirm greater than operations.
41
- on_test [script] :
42
- eval 2 > 1
43
- assert "expected 2 > 1"
37
+ confirm_gt_ops [test] :
38
+ description [string] : Confirm greater than operations.
39
+ on_test [script] :
40
+ eval 2 > 1
41
+ assert "expected 2 > 1"
44
42
 
45
- eval 1 > 2
46
- refute "expected 1 to not be greater than 2"
43
+ eval 1 > 2
44
+ refute "expected 1 to not be greater than 2"
47
45
 
48
- eval 2 > 2
49
- refute "expected 2 to not be greater than 2"
46
+ eval 2 > 2
47
+ refute "expected 2 to not be greater than 2"
50
48
 
51
- eval 3 >= 2
52
- assert "expected 3 >= 2"
49
+ eval 3 >= 2
50
+ assert "expected 3 >= 2"
53
51
 
54
- eval 2 >= 3
55
- refute "expected 2 to not be greater than or equal to 3"
52
+ eval 2 >= 3
53
+ refute "expected 2 to not be greater than or equal to 3"
56
54
 
57
- eval 2 >= 2
58
- assert "expected 2 >= 2"
55
+ eval 2 >= 2
56
+ assert "expected 2 >= 2"
59
57
 
60
- confirm_lt_ops [test] :
61
- description [string] : Confirm less than operations.
62
- on_test [script] :
63
- eval 1 < 2
64
- assert "expected 1 < 2"
58
+ confirm_lt_ops [test] :
59
+ description [string] : Confirm less than operations.
60
+ on_test [script] :
61
+ eval 1 < 2
62
+ assert "expected 1 < 2"
65
63
 
66
- eval 2 < 1
67
- refute "expected 2 to not be less than 1"
64
+ eval 2 < 1
65
+ refute "expected 2 to not be less than 1"
68
66
 
69
- eval 1 < 1
70
- refute "expected 1 to not be less than 1"
67
+ eval 1 < 1
68
+ refute "expected 1 to not be less than 1"
71
69
 
72
- eval 1 <= 2
73
- assert "expected 1 <= 2"
70
+ eval 1 <= 2
71
+ assert "expected 1 <= 2"
74
72
 
75
- eval 2 <= 1
76
- refute "expected 2 to not be less than or equal to 1"
73
+ eval 2 <= 1
74
+ refute "expected 2 to not be less than or equal to 1"
77
75
 
78
- eval 1 <= 1
79
- assert "expected 1 <= 1"
76
+ eval 1 <= 1
77
+ assert "expected 1 <= 1"
@@ -6,24 +6,22 @@
6
6
  # under the last one.
7
7
  #
8
8
 
9
- tests [can] :
10
- lang [can] :
11
- shorthand [can] :
9
+ tests.lang.shorthand [can] :
12
10
 
13
- page.core.title [string] : Home
14
- page.core.count [int] : 3
11
+ page.core.title [string] : Home
12
+ page.core.count [int] : 3
15
13
 
16
- builds_the_container_chain [test] :
17
- description [string] : a dotted name creates a container for each prefix segment.
18
- on_test [script] :
19
- eval ^^.page.core.title = 'Home'
20
- assert "expected the shorthand-built value to be reachable"
14
+ builds_the_container_chain [test] :
15
+ description [string] : a dotted name creates a container for each prefix segment.
16
+ on_test [script] :
17
+ eval ^^.page.core.title = 'Home'
18
+ assert "expected the shorthand-built value to be reachable"
21
19
 
22
- check ^^.page for contains?
23
- assert "expected 'page' to be a real container"
20
+ check ^^.page for contains?
21
+ assert "expected 'page' to be a real container"
24
22
 
25
- reuses_an_existing_prefix [test] :
26
- description [string] : a second shorthand line reuses the same containers.
27
- on_test [script] :
28
- eval ^^.page.core.count = 3
29
- assert "expected both shorthand lines to share the 'core' container"
23
+ reuses_an_existing_prefix [test] :
24
+ description [string] : a second shorthand line reuses the same containers.
25
+ on_test [script] :
26
+ eval ^^.page.core.count = 3
27
+ assert "expected both shorthand lines to share the 'core' container"
@@ -2,45 +2,43 @@
2
2
  # Addition tests
3
3
  #
4
4
 
5
- tests [can] :
6
- math [can] :
7
- add [can] :
8
-
9
- # #
10
- # # Use this test to verify that errors cause the test to fail.
11
- # #
12
- # math_fail [test] :
13
- # description [string] : Expect bad math to fail
14
- # on_test [script] :
15
- # eval 2 + 3 = 2
16
- # assert 'that is wrong!'
17
-
18
- add_ints [test] :
19
- description [string] : Add two integers
20
- on_test [script] :
21
- eval 2 + 3 = 5
22
- assert 'expected 2 + 3 = 5'
23
-
24
- eval 10 + 20 = 30
25
- assert 'expected 10 + 20 = 30'
26
-
27
- eval 100 + 200 = 300
28
- assert 'expected 100 + 200 = 300'
29
-
30
- eval 1 + 2 = 4
31
- refute 'expected 1 + 2 != 4'
32
-
33
- add_decimals [test] :
34
- description [string] : Add two decimals
35
- on_test [script] :
36
- eval 1.5 + 5.5 = 7
37
- assert 'expected 1.5 + 5.5 = 7'
38
-
39
- eval 10.5 + 20.5 = 31
40
- assert 'expected 10.5 + 20.5 = 31'
41
-
42
- eval 100.5 + 200.5 = 301
43
- assert 'expected 100.5 + 200.5 = 301'
44
-
45
- eval 1.5 + 2.5 = 3
46
- refute 'expected 1.5 + 2.5 != 3'
5
+ tests.math.add [can] :
6
+
7
+ # #
8
+ # # Use this test to verify that errors cause the test to fail.
9
+ # #
10
+ # math_fail [test] :
11
+ # description [string] : Expect bad math to fail
12
+ # on_test [script] :
13
+ # eval 2 + 3 = 2
14
+ # assert 'that is wrong!'
15
+
16
+ add_ints [test] :
17
+ description [string] : Add two integers
18
+ on_test [script] :
19
+ eval 2 + 3 = 5
20
+ assert 'expected 2 + 3 = 5'
21
+
22
+ eval 10 + 20 = 30
23
+ assert 'expected 10 + 20 = 30'
24
+
25
+ eval 100 + 200 = 300
26
+ assert 'expected 100 + 200 = 300'
27
+
28
+ eval 1 + 2 = 4
29
+ refute 'expected 1 + 2 != 4'
30
+
31
+ add_decimals [test] :
32
+ description [string] : Add two decimals
33
+ on_test [script] :
34
+ eval 1.5 + 5.5 = 7
35
+ assert 'expected 1.5 + 5.5 = 7'
36
+
37
+ eval 10.5 + 20.5 = 31
38
+ assert 'expected 10.5 + 20.5 = 31'
39
+
40
+ eval 100.5 + 200.5 = 301
41
+ assert 'expected 100.5 + 200.5 = 301'
42
+
43
+ eval 1.5 + 2.5 = 3
44
+ refute 'expected 1.5 + 2.5 != 3'
@@ -2,36 +2,34 @@
2
2
  # Division tests
3
3
  #
4
4
 
5
- tests [can] :
6
- math [can] :
7
- div [can] :
5
+ tests.math.div [can] :
8
6
 
9
- div_ints [test] :
10
- description [string] : Divide two integers
11
- on_test [script] :
12
- eval 6 / 3 = 2
13
- assert 'expected 6 / 3 = 2'
7
+ div_ints [test] :
8
+ description [string] : Divide two integers
9
+ on_test [script] :
10
+ eval 6 / 3 = 2
11
+ assert 'expected 6 / 3 = 2'
14
12
 
15
- eval 20 / 10 = 2
16
- assert 'expected 20 / 10 = 2'
13
+ eval 20 / 10 = 2
14
+ assert 'expected 20 / 10 = 2'
17
15
 
18
- eval 200 / 100 = 2
19
- assert 'expected 200 / 100 = 2'
16
+ eval 200 / 100 = 2
17
+ assert 'expected 200 / 100 = 2'
20
18
 
21
- eval 1 / 3 = 1
22
- refute 'expected 1 / 3 != 1'
19
+ eval 1 / 3 = 1
20
+ refute 'expected 1 / 3 != 1'
23
21
 
24
- div_decimals [test] :
25
- description [string] : Divide two decimals
26
- on_test [script] :
27
- eval 10.2 / 2 = 5.1
28
- assert 'expected 10.2 / 2 = 5.1'
22
+ div_decimals [test] :
23
+ description [string] : Divide two decimals
24
+ on_test [script] :
25
+ eval 10.2 / 2 = 5.1
26
+ assert 'expected 10.2 / 2 = 5.1'
29
27
 
30
- eval 10.5 / 5 = 2.1
31
- assert 'expected 10.5 / 5 = 2.1'
28
+ eval 10.5 / 5 = 2.1
29
+ assert 'expected 10.5 / 5 = 2.1'
32
30
 
33
- eval 100.5 / 200.5 = 0.5
34
- assert 'expected 100.5 / 200.5 = 0.5'
31
+ eval 100.5 / 200.5 = 0.5
32
+ assert 'expected 100.5 / 200.5 = 0.5'
35
33
 
36
- eval 1.5 / 10.5 = 0.1
37
- refute 'expected 1.5 / 10.5 != 0.1'
34
+ eval 1.5 / 10.5 = 0.1
35
+ refute 'expected 1.5 / 10.5 != 0.1'