gloo 6.3.1 → 6.5.0

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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/CLAUDE.md +13 -0
  3. data/docs/application.md +9 -0
  4. data/docs/language_objects.md +78 -0
  5. data/docs/language_scripting.md +41 -0
  6. data/docs/objects.md +1 -1
  7. data/docs/verbs.md +36 -2
  8. data/lib/VERSION +1 -1
  9. data/lib/VERSION_NOTES +13 -0
  10. data/lib/gloo/app/engine.rb +5 -1
  11. data/lib/gloo/app/log.rb +5 -5
  12. data/lib/gloo/app/settings.rb +4 -1
  13. data/lib/gloo/core/obj.rb +60 -1
  14. data/lib/gloo/core/parser.rb +30 -1
  15. data/lib/gloo/core/tokens.rb +44 -18
  16. data/lib/gloo/expr/l_string.rb +8 -4
  17. data/lib/gloo/objs/basic/script.rb +28 -2
  18. data/lib/gloo/objs/web/json.rb +4 -1
  19. data/lib/gloo/persist/comment_buffer.rb +58 -0
  20. data/lib/gloo/persist/declaration_ledger.rb +61 -0
  21. data/lib/gloo/persist/disc_mech.rb +15 -2
  22. data/lib/gloo/persist/file_loader.rb +208 -102
  23. data/lib/gloo/persist/file_saver.rb +251 -6
  24. data/lib/gloo/persist/file_storage.rb +10 -4
  25. data/lib/gloo/persist/indent_stack.rb +90 -0
  26. data/lib/gloo/persist/line_splitter.rb +18 -3
  27. data/lib/gloo/persist/persist_man.rb +193 -26
  28. data/lib/gloo/persist/script_body_collector.rb +102 -0
  29. data/lib/gloo/persist/shorthand_expander.rb +51 -0
  30. data/lib/gloo/persist/source/blank_node.rb +27 -0
  31. data/lib/gloo/persist/source/comment_node.rb +27 -0
  32. data/lib/gloo/persist/source/directive_node.rb +26 -0
  33. data/lib/gloo/persist/source/obj_node.rb +91 -0
  34. data/lib/gloo/persist/source/source_doc.rb +41 -0
  35. data/lib/gloo/verbs/list.rb +24 -2
  36. data/lib/gloo/verbs/load.rb +9 -1
  37. data/lib/gloo/verbs/reload.rb +3 -0
  38. data/lib/gloo/verbs/save.rb +57 -10
  39. data/test.gloo/ctrl/each.test.gloo +28 -30
  40. data/test.gloo/dt/date.test.gloo +69 -71
  41. data/test.gloo/dt/datetime.test.gloo +55 -57
  42. data/test.gloo/dt/time.test.gloo +70 -72
  43. data/test.gloo/lang/continuation.test.gloo +25 -27
  44. data/test.gloo/lang/convert.test.gloo +50 -52
  45. data/test.gloo/lang/dt_comparisons.test.gloo +87 -89
  46. data/test.gloo/lang/exceptions.test.gloo +42 -44
  47. data/test.gloo/lang/gloo_sys.test.gloo +100 -102
  48. data/test.gloo/lang/here.test.gloo +32 -34
  49. data/test.gloo/lang/it.test.gloo +27 -29
  50. data/test.gloo/lang/literal.test.gloo +55 -57
  51. data/test.gloo/lang/load_lib_directive.test.gloo +18 -20
  52. data/test.gloo/lang/naming.test.gloo +28 -30
  53. data/test.gloo/lang/ops.test.gloo +53 -55
  54. data/test.gloo/lang/shorthand.test.gloo +27 -0
  55. data/test.gloo/math/add.test.gloo +40 -42
  56. data/test.gloo/math/div.test.gloo +23 -25
  57. data/test.gloo/math/mult.test.gloo +23 -25
  58. data/test.gloo/math/sub.test.gloo +23 -25
  59. data/test.gloo/objs/alias.test.gloo +15 -17
  60. data/test.gloo/objs/bool.test.gloo +54 -56
  61. data/test.gloo/objs/can.test.gloo +33 -35
  62. data/test.gloo/objs/cipher.test.gloo +39 -41
  63. data/test.gloo/objs/decimal.test.gloo +27 -29
  64. data/test.gloo/objs/erb.test.gloo +47 -49
  65. data/test.gloo/objs/file.test.gloo +68 -70
  66. data/test.gloo/objs/function.test.gloo +37 -39
  67. data/test.gloo/objs/int.test.gloo +54 -56
  68. data/test.gloo/objs/json.test.gloo +57 -50
  69. data/test.gloo/objs/obj.test.gloo +68 -48
  70. data/test.gloo/objs/outline.test.gloo +48 -50
  71. data/test.gloo/objs/password.test.gloo +34 -36
  72. data/test.gloo/objs/repeat.test.gloo +42 -44
  73. data/test.gloo/objs/script.test.gloo +13 -15
  74. data/test.gloo/objs/string.test.gloo +82 -84
  75. data/test.gloo/objs/text.test.gloo +90 -92
  76. data/test.gloo/objs/untyped.test.gloo +36 -38
  77. data/test.gloo/objs/uri.test.gloo +37 -39
  78. data/test.gloo/string/str.test.gloo +15 -0
  79. data/test.gloo/verbs/break.test.gloo +12 -14
  80. data/test.gloo/verbs/check.test.gloo +22 -24
  81. data/test.gloo/verbs/context.test.gloo +11 -13
  82. data/test.gloo/verbs/create.test.gloo +7 -9
  83. data/test.gloo/verbs/eval.test.gloo +10 -12
  84. data/test.gloo/verbs/exists.test.gloo +43 -45
  85. data/test.gloo/verbs/if.test.gloo +8 -10
  86. data/test.gloo/verbs/invoke.test.gloo +73 -75
  87. data/test.gloo/verbs/list.test.gloo +21 -23
  88. data/test.gloo/verbs/load.test.gloo +27 -21
  89. data/test.gloo/verbs/log.test.gloo +7 -9
  90. data/test.gloo/verbs/move.test.gloo +12 -14
  91. data/test.gloo/verbs/put.test.gloo +10 -12
  92. data/test.gloo/verbs/reload.test.gloo +55 -0
  93. data/test.gloo/verbs/run.test.gloo +8 -10
  94. data/test.gloo/verbs/save.test.gloo +111 -0
  95. data/test.gloo/verbs/show.test.gloo +26 -28
  96. data/test.gloo/verbs/tell.test.gloo +8 -10
  97. data/test.gloo/verbs/throw.test.gloo +31 -33
  98. data/test.gloo/verbs/unless.test.gloo +13 -15
  99. data/test.gloo/verbs/unload.test.gloo +10 -12
  100. metadata +14 -1
@@ -2,47 +2,45 @@
2
2
  # Repeat object tests
3
3
  #
4
4
 
5
- tests [can] :
6
- objs [can] :
7
- repeat [can] :
8
-
9
- count [int] : 0
10
- seen [string] :
11
-
12
- loop [repeat] :
13
- times [integer] : 4
14
- index [integer] : 0
15
- do [script] :
16
- put tests.objs.repeat.count + 1 into tests.objs.repeat.count
17
- put tests.objs.repeat.seen + tests.objs.repeat.loop.index into tests.objs.repeat.seen
18
-
19
- zero [repeat] :
20
- times [integer] : 0
21
- index [integer] : 0
22
- do [script] :
23
- put tests.objs.repeat.count + 100 into tests.objs.repeat.count
24
-
25
- runs_the_do_script_n_times [test] :
26
- description [string] : run executes 'do' once per 'times', and 'index' walks 0..times-1.
27
- on_test [script] :
28
- put 0 into ^^.count
29
- put '' into ^^.seen
30
-
31
- tell ^^.loop to run
32
-
33
- eval ^^.count = 4
34
- assert "expected the do script to run 4 times"
35
-
36
- eval ^^.seen = '0123'
37
- assert "expected index to be 0,1,2,3 across the iterations"
38
-
39
- eval ^^.loop.index = 3
40
- assert "expected index to be left at times-1 after the run"
41
-
42
- zero_times_does_nothing [test] :
43
- description [string] : run with times = 0 never executes 'do'.
44
- on_test [script] :
45
- put 0 into ^^.count
46
- tell ^^.zero to run
47
- eval ^^.count = 0
48
- assert "expected the do script not to run when times is 0"
5
+ tests.objs.repeat [can] :
6
+
7
+ count [int] : 0
8
+ seen [string] :
9
+
10
+ loop [repeat] :
11
+ times [integer] : 4
12
+ index [integer] : 0
13
+ do [script] :
14
+ put tests.objs.repeat.count + 1 into tests.objs.repeat.count
15
+ put tests.objs.repeat.seen + tests.objs.repeat.loop.index into tests.objs.repeat.seen
16
+
17
+ zero [repeat] :
18
+ times [integer] : 0
19
+ index [integer] : 0
20
+ do [script] :
21
+ put tests.objs.repeat.count + 100 into tests.objs.repeat.count
22
+
23
+ runs_the_do_script_n_times [test] :
24
+ description [string] : run executes 'do' once per 'times', and 'index' walks 0..times-1.
25
+ on_test [script] :
26
+ put 0 into ^^.count
27
+ put '' into ^^.seen
28
+
29
+ tell ^^.loop to run
30
+
31
+ eval ^^.count = 4
32
+ assert "expected the do script to run 4 times"
33
+
34
+ eval ^^.seen = '0123'
35
+ assert "expected index to be 0,1,2,3 across the iterations"
36
+
37
+ eval ^^.loop.index = 3
38
+ assert "expected index to be left at times-1 after the run"
39
+
40
+ zero_times_does_nothing [test] :
41
+ description [string] : run with times = 0 never executes 'do'.
42
+ on_test [script] :
43
+ put 0 into ^^.count
44
+ tell ^^.zero to run
45
+ eval ^^.count = 0
46
+ assert "expected the do script not to run when times is 0"
@@ -2,22 +2,20 @@
2
2
  # Script tests
3
3
  #
4
4
 
5
- tests [can] :
6
- objs [can] :
7
- script [can] :
5
+ tests.objs.script [can] :
8
6
 
9
- a [script] :
10
- b [boolean] : true
7
+ a [script] :
8
+ b [boolean] : true
11
9
 
12
- run_script [test] :
13
- description [string] : Set the value of the script
14
- on_test [script] :
15
- put "eval 2 + 5" into ^^.a
16
- tell ^^.a to run
17
- eval it = 7
18
- assert "expected it to be 7"
10
+ run_script [test] :
11
+ description [string] : Set the value of the script
12
+ on_test [script] :
13
+ put "eval 2 + 5" into ^^.a
14
+ tell ^^.a to run
15
+ eval it = 7
16
+ assert "expected it to be 7"
19
17
 
20
- put "eval ^.b = true" into ^^.a
21
- tell run ^^.a
22
- assert "expected it to be true"
18
+ put "eval ^.b = true" into ^^.a
19
+ run ^^.a
20
+ assert "expected it to be true"
23
21
 
@@ -2,97 +2,95 @@
2
2
  # String tests
3
3
  #
4
4
 
5
- tests [can] :
6
- objs [can] :
7
- string [can] :
5
+ tests.objs.string [can] :
8
6
 
9
- s [string] :
10
- dst [can] :
7
+ s [string] :
8
+ dst [can] :
11
9
 
12
- up_down [test] :
13
- description [string] : Convert string case
14
- on_test [script] :
15
- put 'hello' into ^^.s
16
- tell ^^.s to up
17
- eval ^^.s = 'HELLO'
18
- assert "expected string to be uppercase"
19
- tell ^^.s to down
20
- eval ^^.s = 'hello'
21
- assert "expected string to be lowercase"
10
+ up_down [test] :
11
+ description [string] : Convert string case
12
+ on_test [script] :
13
+ put 'hello' into ^^.s
14
+ tell ^^.s to up
15
+ eval ^^.s = 'HELLO'
16
+ assert "expected string to be uppercase"
17
+ tell ^^.s to down
18
+ eval ^^.s = 'hello'
19
+ assert "expected string to be lowercase"
22
20
 
23
- trim [test] :
24
- description [string] : Trim whitespace from a string
25
- on_test [script] :
26
- put ' hello ' into ^^.s
27
- tell ^^.s to trim
28
- eval it = 'hello'
29
- assert "expected trimmed string to equal 'hello'"
21
+ trim [test] :
22
+ description [string] : Trim whitespace from a string
23
+ on_test [script] :
24
+ put ' hello ' into ^^.s
25
+ tell ^^.s to trim
26
+ eval it = 'hello'
27
+ assert "expected trimmed string to equal 'hello'"
30
28
 
31
- sub [test] :
32
- description [string] : Substitute in a string
33
- on_test [script] :
34
- put 'hello world' into ^^.s
35
- tell ^^.s to sub ('world' 'gloo')
36
- eval it = 'hello gloo'
37
- assert "expected substituted string to equal 'hello gloo'"
29
+ sub [test] :
30
+ description [string] : Substitute in a string
31
+ on_test [script] :
32
+ put 'hello world' into ^^.s
33
+ tell ^^.s to sub ('world' 'gloo')
34
+ eval it = 'hello gloo'
35
+ assert "expected substituted string to equal 'hello gloo'"
38
36
 
39
- count_chars [test] :
40
- description [string] : Count the characters in a string
41
- on_test [script] :
42
- put 'hello' into ^^.s
43
- tell ^^.s to count_chars
44
- eval it = 5
45
- assert "expected 5 characters"
37
+ count_chars [test] :
38
+ description [string] : Count the characters in a string
39
+ on_test [script] :
40
+ put 'hello' into ^^.s
41
+ tell ^^.s to count_chars
42
+ eval it = 5
43
+ assert "expected 5 characters"
46
44
 
47
- split [test] :
48
- description [string] : Get a substring between two indexes
49
- on_test [script] :
50
- put 'one two three' into ^^.s
51
- tell ^^.s to split (4 7)
52
- eval it = 'two'
53
- assert "expected split (4 7) to equal 'two'"
54
- eval ^^.s = 'one two three'
55
- assert "expected split to leave the string unchanged"
45
+ split [test] :
46
+ description [string] : Get a substring between two indexes
47
+ on_test [script] :
48
+ put 'one two three' into ^^.s
49
+ tell ^^.s to split (4 7)
50
+ eval it = 'two'
51
+ assert "expected split (4 7) to equal 'two'"
52
+ eval ^^.s = 'one two three'
53
+ assert "expected split to leave the string unchanged"
56
54
 
57
- splitl [test] :
58
- description [string] : Get the substring to the left of an index
59
- on_test [script] :
60
- put 'one two three' into ^^.s
61
- tell ^^.s to splitl (7)
62
- eval it = 'one two'
63
- assert "expected splitl (7) to equal 'one two'"
55
+ splitl [test] :
56
+ description [string] : Get the substring to the left of an index
57
+ on_test [script] :
58
+ put 'one two three' into ^^.s
59
+ tell ^^.s to splitl (7)
60
+ eval it = 'one two'
61
+ assert "expected splitl (7) to equal 'one two'"
64
62
 
65
- splitr [test] :
66
- description [string] : Get the substring from an index to the end
67
- on_test [script] :
68
- put 'one two three' into ^^.s
69
- tell ^^.s to splitr (4)
70
- eval it = 'two three'
71
- assert "expected splitr (4) to equal 'two three'"
63
+ splitr [test] :
64
+ description [string] : Get the substring from an index to the end
65
+ on_test [script] :
66
+ put 'one two three' into ^^.s
67
+ tell ^^.s to splitr (4)
68
+ eval it = 'two three'
69
+ assert "expected splitr (4) to equal 'two three'"
72
70
 
73
- split_out_of_range [test] :
74
- description [string] : Out-of-range split indexes clamp to the string's bounds
75
- on_test [script] :
76
- put 'one two three' into ^^.s
77
- tell ^^.s to split (-5 4)
78
- eval it = 'one '
79
- assert "expected split (-5 4) to clamp to 'one '"
80
- tell ^^.s to split (8 100)
81
- eval it = 'three'
82
- assert "expected split (8 100) to clamp to 'three'"
71
+ split_out_of_range [test] :
72
+ description [string] : Out-of-range split indexes clamp to the string's bounds
73
+ on_test [script] :
74
+ put 'one two three' into ^^.s
75
+ tell ^^.s to split (-5 4)
76
+ eval it = 'one '
77
+ assert "expected split (-5 4) to clamp to 'one '"
78
+ tell ^^.s to split (8 100)
79
+ eval it = 'three'
80
+ assert "expected split (8 100) to clamp to 'three'"
83
81
 
84
- split_list [test] :
85
- description [string] : Split a string into children of a target container
86
- on_test [script] :
87
- put 'one,two,three' into ^^.s
88
- tell ^^.s to split_list (',' ^^.dst)
89
- eval it = 3
90
- assert "expected split_list to put the part count into it"
91
- eval ^^.dst.1 = 'one'
92
- assert "expected dst.1 to equal 'one'"
93
- eval ^^.dst.2 = 'two'
94
- assert "expected dst.2 to equal 'two'"
95
- eval ^^.dst.3 = 'three'
96
- assert "expected dst.3 to equal 'three'"
97
- eval ^^.s = 'one,two,three'
98
- assert "expected split_list to leave the string unchanged"
82
+ split_list [test] :
83
+ description [string] : Split a string into children of a target container
84
+ on_test [script] :
85
+ put 'one,two,three' into ^^.s
86
+ tell ^^.s to split_list (',' ^^.dst)
87
+ eval it = 3
88
+ assert "expected split_list to put the part count into it"
89
+ eval ^^.dst.1 = 'one'
90
+ assert "expected dst.1 to equal 'one'"
91
+ eval ^^.dst.2 = 'two'
92
+ assert "expected dst.2 to equal 'two'"
93
+ eval ^^.dst.3 = 'three'
94
+ assert "expected dst.3 to equal 'three'"
95
+ eval ^^.s = 'one,two,three'
96
+ assert "expected split_list to leave the string unchanged"
@@ -2,104 +2,102 @@
2
2
  # Text tests
3
3
  #
4
4
 
5
- tests [can] :
6
- objs [can] :
7
- text [can] :
5
+ tests.objs.text [can] :
8
6
 
9
- a [text] : BEGIN
7
+ a [text] : BEGIN
10
8
  one
11
9
  two
12
10
  three 3 tree
13
11
  END
14
12
 
15
- # inside a block every line is literal - '#' lines and blank
16
- # lines are kept, not treated as comments/blanks
17
- hashed [text] : BEGIN
13
+ # inside a block every line is literal - '#' lines and blank
14
+ # lines are kept, not treated as comments/blanks
15
+ hashed [text] : BEGIN
18
16
  # a heading
19
17
 
20
18
  - a list item
21
- END
22
-
23
- b [string] :
24
-
25
- verify_text [test] :
26
- description [string] : Verify the content of the text
27
- on_test [script] :
28
- put ^^.a into ^^.b
29
- check ^^.b for starts_with? (" one")
30
- assert "expected it to be true"
31
-
32
- blank [test] :
33
- description [string] : Check to see if the text is blank
34
- on_test [script] :
35
- put '' into ^^.b
36
- check ^^.b for blank?
37
- assert "expected text to be blank?"
38
-
39
- put 'abc' into ^^.b
40
- check ^^.b for blank?
41
- refute "expected text to not be blank?"
42
-
43
- length [test] :
44
- description [string] : Get the length of the string
45
- on_test [script] :
46
- put 'hello' into ^^.b
47
- tell ^^.b to size
48
- eval it = 5
49
- assert "expected length to be 5"
50
-
51
- count_chars [test] :
52
- description [string] : Get the number of characters
53
- on_test [script] :
54
- put 'hello world' into ^^.b
55
- tell ^^.b to count_chars
56
- eval it = 11
57
- assert "expected text to have 11 characters"
58
-
59
- count_words [test] :
60
- description [string] : Get the number of words
61
- on_test [script] :
62
- tell ^^.a to count_words
63
- eval it = 5
64
- assert "expected text to have 5 words"
65
-
66
- count_lines [test] :
67
- description [string] : Get the number of lines
68
- on_test [script] :
69
- tell ^^.a to count_lines
70
- eval it = 3
71
- assert "expected text to have 3 lines"
72
-
73
- block_keeps_hash_and_blank_lines [test] :
74
- description [string] : a BEGIN/END block keeps '#' lines and blank lines verbatim
75
- on_test [script] :
76
- check ^^.hashed for substring? ( "# a heading" )
77
- assert "expected the '#' line to be kept, not stripped as a comment"
78
-
79
- check ^^.hashed for substring? ( "- a list item" )
80
- assert "expected content after the blank line to be kept"
81
-
82
- tell ^^.hashed to count_lines
83
- eval it = 3
84
- assert "expected 3 lines: heading, blank, list item"
85
-
86
- starts_with [test] :
87
- description [string] : Check if the string starts with a value
88
- on_test [script] :
89
- put 'hello' into ^^.b
90
- tell ^^.b to starts_with? ('he')
91
- assert "expected it to be true that it starts with 'he'"
92
-
93
- ends_with [test] :
94
- description [string] : Check if the string ends with a value
95
- on_test [script] :
96
- put 'hello' into ^^.b
97
- tell ^^.b to ends_with? ('lo')
98
- assert "expected it to be true that it ends with 'lo'"
99
-
100
- contains [test] :
101
- description [string] : Check if the string contains a value
102
- on_test [script] :
103
- put 'hello world' into ^^.b
104
- tell ^^.b to substring? ('lo w')
105
- assert "expected it to be true that it contains 'lo w'"
19
+ END
20
+
21
+ b [string] :
22
+
23
+ verify_text [test] :
24
+ description [string] : Verify the content of the text
25
+ on_test [script] :
26
+ put ^^.a into ^^.b
27
+ check ^^.b for starts_with? (" one")
28
+ assert "expected it to be true"
29
+
30
+ blank [test] :
31
+ description [string] : Check to see if the text is blank
32
+ on_test [script] :
33
+ put '' into ^^.b
34
+ check ^^.b for blank?
35
+ assert "expected text to be blank?"
36
+
37
+ put 'abc' into ^^.b
38
+ check ^^.b for blank?
39
+ refute "expected text to not be blank?"
40
+
41
+ length [test] :
42
+ description [string] : Get the length of the string
43
+ on_test [script] :
44
+ put 'hello' into ^^.b
45
+ tell ^^.b to size
46
+ eval it = 5
47
+ assert "expected length to be 5"
48
+
49
+ count_chars [test] :
50
+ description [string] : Get the number of characters
51
+ on_test [script] :
52
+ put 'hello world' into ^^.b
53
+ tell ^^.b to count_chars
54
+ eval it = 11
55
+ assert "expected text to have 11 characters"
56
+
57
+ count_words [test] :
58
+ description [string] : Get the number of words
59
+ on_test [script] :
60
+ tell ^^.a to count_words
61
+ eval it = 5
62
+ assert "expected text to have 5 words"
63
+
64
+ count_lines [test] :
65
+ description [string] : Get the number of lines
66
+ on_test [script] :
67
+ tell ^^.a to count_lines
68
+ eval it = 3
69
+ assert "expected text to have 3 lines"
70
+
71
+ block_keeps_hash_and_blank_lines [test] :
72
+ description [string] : a BEGIN/END block keeps '#' lines and blank lines verbatim
73
+ on_test [script] :
74
+ check ^^.hashed for substring? ( "# a heading" )
75
+ assert "expected the '#' line to be kept, not stripped as a comment"
76
+
77
+ check ^^.hashed for substring? ( "- a list item" )
78
+ assert "expected content after the blank line to be kept"
79
+
80
+ tell ^^.hashed to count_lines
81
+ eval it = 3
82
+ assert "expected 3 lines: heading, blank, list item"
83
+
84
+ starts_with [test] :
85
+ description [string] : Check if the string starts with a value
86
+ on_test [script] :
87
+ put 'hello' into ^^.b
88
+ tell ^^.b to starts_with? ('he')
89
+ assert "expected it to be true that it starts with 'he'"
90
+
91
+ ends_with [test] :
92
+ description [string] : Check if the string ends with a value
93
+ on_test [script] :
94
+ put 'hello' into ^^.b
95
+ tell ^^.b to ends_with? ('lo')
96
+ assert "expected it to be true that it ends with 'lo'"
97
+
98
+ contains [test] :
99
+ description [string] : Check if the string contains a value
100
+ on_test [script] :
101
+ put 'hello world' into ^^.b
102
+ tell ^^.b to substring? ('lo w')
103
+ assert "expected it to be true that it contains 'lo w'"
@@ -2,42 +2,40 @@
2
2
  # Untyped object tests
3
3
  #
4
4
 
5
- tests [can] :
6
- objs [can] :
7
- untyped [can] :
8
-
9
- a [any] :
10
-
11
- test_untyped [test] :
12
- description [string] : Test untyped with different values
13
- on_test [script] :
14
- put "hello" into ^^.a
15
- eval ^^.a = "hello"
16
- assert "expected it to be hello"
17
-
18
- put 123 into ^^.a
19
- eval ^^.a = 123
20
- assert "expected it to be 123"
21
-
22
- put true into ^^.a
23
- eval ^^.a = true
24
- assert "expected it to be true"
25
-
26
- base_messages_work [test] :
27
- description [string] : an untyped object still receives the base object messages
28
- on_test [script] :
29
- put "" into ^^.a
30
- check ^^.a for blank?
31
- assert "expected an empty untyped object to be blank"
32
-
33
- put "x" into ^^.a
34
- check ^^.a for blank?
35
- refute "expected a non-empty untyped object to not be blank"
36
-
37
- type_messages_do_not [test] :
38
- description [string] : an untyped object does not receive type-specific messages
39
- on_test [script] :
40
- put "hello" into ^^.a
41
- check ^^.a for responds_to? ( "up" )
42
- refute "expected an untyped object to not respond to 'up'"
5
+ tests.objs.untyped [can] :
6
+
7
+ a [any] :
8
+
9
+ test_untyped [test] :
10
+ description [string] : Test untyped with different values
11
+ on_test [script] :
12
+ put "hello" into ^^.a
13
+ eval ^^.a = "hello"
14
+ assert "expected it to be hello"
15
+
16
+ put 123 into ^^.a
17
+ eval ^^.a = 123
18
+ assert "expected it to be 123"
19
+
20
+ put true into ^^.a
21
+ eval ^^.a = true
22
+ assert "expected it to be true"
23
+
24
+ base_messages_work [test] :
25
+ description [string] : an untyped object still receives the base object messages
26
+ on_test [script] :
27
+ put "" into ^^.a
28
+ check ^^.a for blank?
29
+ assert "expected an empty untyped object to be blank"
30
+
31
+ put "x" into ^^.a
32
+ check ^^.a for blank?
33
+ refute "expected a non-empty untyped object to not be blank"
34
+
35
+ type_messages_do_not [test] :
36
+ description [string] : an untyped object does not receive type-specific messages
37
+ on_test [script] :
38
+ put "hello" into ^^.a
39
+ check ^^.a for responds_to? ( "up" )
40
+ refute "expected an untyped object to not respond to 'up'"
43
41