gloo 6.7.2 → 7.0.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.
- checksums.yaml +4 -4
- data/CLAUDE.md +1 -0
- data/docs/application.md +3 -1
- data/docs/iterators.md +39 -3
- data/docs/language_syntax.md +53 -5
- data/docs/objects.md +59 -2
- data/docs/operators.md +16 -0
- data/docs/plugins.md +9 -1
- data/docs/verbs.md +4 -2
- data/lib/VERSION +1 -1
- data/lib/VERSION_NOTES +24 -0
- data/lib/gloo/app/engine.rb +64 -8
- data/lib/gloo/app/log.rb +47 -6
- data/lib/gloo/convert/converter.rb +63 -2
- data/lib/gloo/convert/string_to_date.rb +14 -0
- data/lib/gloo/convert/string_to_datetime.rb +16 -0
- data/lib/gloo/convert/string_to_decimal.rb +13 -0
- data/lib/gloo/convert/string_to_integer.rb +9 -2
- data/lib/gloo/convert/string_to_time.rb +28 -0
- data/lib/gloo/core/error.rb +11 -2
- data/lib/gloo/core/event_manager.rb +7 -4
- data/lib/gloo/core/factory.rb +16 -11
- data/lib/gloo/core/gloo_system.rb +3 -2
- data/lib/gloo/core/here.rb +6 -1
- data/lib/gloo/core/invoker.rb +2 -3
- data/lib/gloo/core/not_found.rb +42 -0
- data/lib/gloo/core/obj.rb +30 -3
- data/lib/gloo/core/op.rb +2 -0
- data/lib/gloo/core/parser.rb +1 -1
- data/lib/gloo/core/pn.rb +33 -12
- data/lib/gloo/core/tokens.rb +38 -0
- data/lib/gloo/core/verb.rb +54 -0
- data/lib/gloo/exec/dispatch.rb +5 -6
- data/lib/gloo/exec/exec_env.rb +13 -0
- data/lib/gloo/exec/runner.rb +10 -2
- data/lib/gloo/exec/script.rb +13 -1
- data/lib/gloo/expr/expression.rb +39 -1
- data/lib/gloo/expr/op_plus.rb +3 -0
- data/lib/gloo/objs/basic/boolean.rb +16 -0
- data/lib/gloo/objs/basic/container.rb +154 -6
- data/lib/gloo/objs/basic/decimal.rb +1 -0
- data/lib/gloo/objs/basic/integer.rb +1 -0
- data/lib/gloo/objs/basic/string.rb +0 -1
- data/lib/gloo/objs/basic/string_msgs.rb +68 -32
- data/lib/gloo/objs/ctrl/each.rb +22 -3
- data/lib/gloo/objs/ctrl/each_dir.rb +20 -7
- data/lib/gloo/objs/ctrl/each_file.rb +78 -9
- data/lib/gloo/objs/ctrl/function.rb +6 -5
- data/lib/gloo/objs/dt/date.rb +28 -11
- data/lib/gloo/objs/dt/datetime.rb +72 -21
- data/lib/gloo/objs/dt/dt_tools.rb +46 -2
- data/lib/gloo/objs/dt/time.rb +28 -11
- data/lib/gloo/objs/str_utils/cipher.rb +17 -4
- data/lib/gloo/objs/str_utils/password.rb +6 -2
- data/lib/gloo/objs/system/erb.rb +9 -3
- data/lib/gloo/objs/system/file_handle.rb +57 -21
- data/lib/gloo/objs/system/system.rb +6 -2
- data/lib/gloo/objs/web/http_get.rb +12 -2
- data/lib/gloo/objs/web/http_post.rb +6 -2
- data/lib/gloo/objs/web/json.rb +38 -18
- data/lib/gloo/objs/web/uri.rb +36 -16
- data/lib/gloo/persist/file_loader.rb +72 -11
- data/lib/gloo/persist/file_saver.rb +2 -1
- data/lib/gloo/persist/indent_stack.rb +49 -33
- data/lib/gloo/persist/line_splitter.rb +40 -3
- data/lib/gloo/persist/persist_man.rb +2 -4
- data/lib/gloo/plugin/ext_manager.rb +6 -9
- data/lib/gloo/plugin/lib_manager.rb +2 -2
- data/lib/gloo/verbs/break.rb +1 -0
- data/lib/gloo/verbs/check.rb +1 -1
- data/lib/gloo/verbs/cls.rb +1 -0
- data/lib/gloo/verbs/create.rb +32 -4
- data/lib/gloo/verbs/execute.rb +1 -1
- data/lib/gloo/verbs/exists.rb +27 -15
- data/lib/gloo/verbs/files.rb +2 -1
- data/lib/gloo/verbs/help.rb +1 -0
- data/lib/gloo/verbs/if.rb +1 -1
- data/lib/gloo/verbs/invoke.rb +1 -1
- data/lib/gloo/verbs/list.rb +4 -3
- data/lib/gloo/verbs/load.rb +3 -3
- data/lib/gloo/verbs/move.rb +10 -8
- data/lib/gloo/verbs/put.rb +20 -8
- data/lib/gloo/verbs/quit.rb +1 -0
- data/lib/gloo/verbs/redirect.rb +8 -2
- data/lib/gloo/verbs/reload.rb +9 -1
- data/lib/gloo/verbs/run.rb +2 -2
- data/lib/gloo/verbs/save.rb +4 -2
- data/lib/gloo/verbs/tell.rb +1 -1
- data/lib/gloo/verbs/unless.rb +1 -1
- data/lib/gloo/verbs/unload.rb +8 -0
- data/test.gloo/ctrl/each.test.gloo +88 -0
- data/test.gloo/dt/datetime.test.gloo +5 -3
- data/test.gloo/lang/convert.test.gloo +1 -0
- data/test.gloo/lang/declaration.test.gloo +38 -0
- data/test.gloo/lang/exceptions.test.gloo +68 -0
- data/test.gloo/lang/failures.test.gloo +143 -0
- data/test.gloo/lang/gloo_sys.test.gloo +14 -9
- data/test.gloo/lang/it.test.gloo +139 -0
- data/test.gloo/lang/naming.test.gloo +21 -0
- data/test.gloo/lang/ops.test.gloo +30 -0
- data/test.gloo/math/div.test.gloo +2 -2
- data/test.gloo/math/mult.test.gloo +4 -4
- data/test.gloo/objs/can.test.gloo +104 -0
- data/test.gloo/objs/function.test.gloo +1 -0
- data/test.gloo/objs/string.test.gloo +24 -0
- data/test.gloo/string/str.test.gloo +28 -0
- data/test.gloo/verbs/check.test.gloo +10 -1
- data/test.gloo/verbs/create.test.gloo +37 -0
- data/test.gloo/verbs/exists.test.gloo +34 -1
- data/test.gloo/verbs/invoke.test.gloo +1 -0
- data/test.gloo/verbs/list.test.gloo +1 -0
- data/test.gloo/verbs/load.test.gloo +2 -0
- data/test.gloo/verbs/reload.test.gloo +1 -0
- data/test.gloo/verbs/save.test.gloo +2 -0
- data/test.gloo/verbs/throw.test.gloo +2 -0
- data/test.gloo/verbs/unload.test.gloo +35 -0
- metadata +4 -1
|
@@ -25,11 +25,11 @@ tests.math.mult [can] :
|
|
|
25
25
|
eval 1.5 * 5.5 = 8.25
|
|
26
26
|
assert 'expected 1.5 * 5.5 = 8.25'
|
|
27
27
|
|
|
28
|
-
eval 10.5 * 20.5 =
|
|
29
|
-
assert 'expected 10.5 * 20.5 =
|
|
28
|
+
eval 10.5 * 20.5 = 215.25
|
|
29
|
+
assert 'expected 10.5 * 20.5 = 215.25'
|
|
30
30
|
|
|
31
|
-
eval 100.5 * 200.5 =
|
|
32
|
-
assert 'expected 100.5 * 200.5 =
|
|
31
|
+
eval 100.5 * 200.5 = 20150.25
|
|
32
|
+
assert 'expected 100.5 * 200.5 = 20150.25'
|
|
33
33
|
|
|
34
34
|
eval 1.5 * 10.5 = 10
|
|
35
35
|
refute 'expected 1.5 * 10.5 != 10'
|
|
@@ -43,3 +43,107 @@ tests.objs.can [can] :
|
|
|
43
43
|
eval it = 0
|
|
44
44
|
assert "expected it to be 0"
|
|
45
45
|
|
|
46
|
+
|
|
47
|
+
#
|
|
48
|
+
# Child value and path messages.
|
|
49
|
+
#
|
|
50
|
+
|
|
51
|
+
tests.objs.can_child [can] :
|
|
52
|
+
|
|
53
|
+
list [can] :
|
|
54
|
+
x [string] : ex
|
|
55
|
+
y [integer] : 7
|
|
56
|
+
book [can] :
|
|
57
|
+
title [string] : Walden
|
|
58
|
+
|
|
59
|
+
empty [can] :
|
|
60
|
+
path [string] :
|
|
61
|
+
ptr [alias] :
|
|
62
|
+
slot [alias] :
|
|
63
|
+
idx [integer] : 0
|
|
64
|
+
n [integer] : 0
|
|
65
|
+
found [integer] : 0
|
|
66
|
+
picked [can] :
|
|
67
|
+
|
|
68
|
+
# Pick distinct random children: a random index, skipped if already used.
|
|
69
|
+
pick_distinct [repeat] :
|
|
70
|
+
times [integer] : 200
|
|
71
|
+
index [integer] : 0
|
|
72
|
+
do [script] :
|
|
73
|
+
tell tests.objs.can_child.idx to randomize ( tests.objs.can_child.n )
|
|
74
|
+
check tests.objs.can_child.picked for child_exists ( tests.objs.can_child.idx )
|
|
75
|
+
unless it do tell tests.objs.can_child.mark to run
|
|
76
|
+
|
|
77
|
+
mark [script] :
|
|
78
|
+
put 'tests.objs.can_child.picked.' + tests.objs.can_child.idx into tests.objs.can_child.slot*
|
|
79
|
+
create tests.objs.can_child.slot* as integer
|
|
80
|
+
put tests.objs.can_child.found + 1 into tests.objs.can_child.found
|
|
81
|
+
|
|
82
|
+
value_at [test] :
|
|
83
|
+
description [string] : child_value_at gets a simple child's value by 0-based index.
|
|
84
|
+
on_test [script] :
|
|
85
|
+
tell ^^.list to child_value_at ( 0 )
|
|
86
|
+
eval it = 'ex'
|
|
87
|
+
assert "expected index 0 to be the first child"
|
|
88
|
+
|
|
89
|
+
tell ^^.list to child_value_at ( 1 )
|
|
90
|
+
eval it = 7
|
|
91
|
+
assert "expected index 1 to be the second child"
|
|
92
|
+
|
|
93
|
+
value_at_container_child [test] :
|
|
94
|
+
description [string] : child_value_at on a container child is an error, and it is false.
|
|
95
|
+
expect_errors [bool] : true
|
|
96
|
+
on_test [script] :
|
|
97
|
+
tell ^^.list to child_value_at ( 2 )
|
|
98
|
+
eval it = false
|
|
99
|
+
assert "expected false for a container child"
|
|
100
|
+
|
|
101
|
+
path_at_alias [test] :
|
|
102
|
+
description [string] : child_path_at into an alias reaches a container child's fields.
|
|
103
|
+
on_test [script] :
|
|
104
|
+
tell ^^.list to child_path_at ( 2 )
|
|
105
|
+
put it into ^^.path
|
|
106
|
+
eval ^^.path = 'tests.objs.can_child.list.book'
|
|
107
|
+
assert "expected the path from root"
|
|
108
|
+
|
|
109
|
+
put ^^.path into ^^.ptr*
|
|
110
|
+
eval ^^.ptr.title = 'Walden'
|
|
111
|
+
assert "expected to read the field through the alias"
|
|
112
|
+
|
|
113
|
+
out_of_range [test] :
|
|
114
|
+
description [string] : An out-of-range index is an error, and it is false.
|
|
115
|
+
expect_errors [bool] : true
|
|
116
|
+
on_test [script] :
|
|
117
|
+
tell ^^.list to child_path_at ( 3 )
|
|
118
|
+
eval it = false
|
|
119
|
+
assert "expected false for index 3 of 3 children"
|
|
120
|
+
|
|
121
|
+
random_path [test] :
|
|
122
|
+
description [string] : random_child_path gives the path of one of the children.
|
|
123
|
+
on_test [script] :
|
|
124
|
+
tell ^^.list to random_child_path
|
|
125
|
+
put it into ^^.path
|
|
126
|
+
check ^^.path for starts_with? ( 'tests.objs.can_child.list.' )
|
|
127
|
+
assert "expected a child's path"
|
|
128
|
+
|
|
129
|
+
random_empty [test] :
|
|
130
|
+
description [string] : random_child_value on an empty container is an error, and it is false.
|
|
131
|
+
expect_errors [bool] : true
|
|
132
|
+
on_test [script] :
|
|
133
|
+
tell ^^.empty to random_child_value
|
|
134
|
+
eval it = false
|
|
135
|
+
assert "expected false for an empty container"
|
|
136
|
+
|
|
137
|
+
distinct_random_picks [test] :
|
|
138
|
+
description [string] : A random index plus a picked container gives distinct picks.
|
|
139
|
+
on_test [script] :
|
|
140
|
+
tell ^^.list to count
|
|
141
|
+
put it into ^^.n
|
|
142
|
+
tell ^^.pick_distinct to run
|
|
143
|
+
|
|
144
|
+
tell ^^.picked to count
|
|
145
|
+
eval it = 3
|
|
146
|
+
assert "expected every child picked exactly once"
|
|
147
|
+
|
|
148
|
+
eval ^^.found = 3
|
|
149
|
+
assert "expected no index to be picked twice"
|
|
@@ -52,6 +52,30 @@ tests.objs.string [can] :
|
|
|
52
52
|
eval ^^.s = 'one two three'
|
|
53
53
|
assert "expected split to leave the string unchanged"
|
|
54
54
|
|
|
55
|
+
index_of [test] :
|
|
56
|
+
description [string] : Find the position of a substring
|
|
57
|
+
on_test [script] :
|
|
58
|
+
put 'one two three' into ^^.s
|
|
59
|
+
tell ^^.s to index_of ('two')
|
|
60
|
+
eval it = 4
|
|
61
|
+
assert "expected index_of ('two') to equal 4"
|
|
62
|
+
tell ^^.s to index_of ('four')
|
|
63
|
+
eval it = -1
|
|
64
|
+
assert "expected index_of a missing needle to equal -1"
|
|
65
|
+
eval ^^.s = 'one two three'
|
|
66
|
+
assert "expected index_of to leave the string unchanged"
|
|
67
|
+
|
|
68
|
+
index_of_from [test] :
|
|
69
|
+
description [string] : Find a substring at or after a start position
|
|
70
|
+
on_test [script] :
|
|
71
|
+
put '![[123.png]] and ]]' into ^^.s
|
|
72
|
+
tell ^^.s to index_of (']]' 3)
|
|
73
|
+
eval it = 10
|
|
74
|
+
assert "expected index_of (']]' 3) to equal 10"
|
|
75
|
+
tell ^^.s to index_of (']]' 11)
|
|
76
|
+
eval it = 17
|
|
77
|
+
assert "expected index_of (']]' 11) to equal 17"
|
|
78
|
+
|
|
55
79
|
splitl [test] :
|
|
56
80
|
description [string] : Get the substring to the left of an index
|
|
57
81
|
on_test [script] :
|
|
@@ -131,3 +131,31 @@ tests [can] :
|
|
|
131
131
|
tell ^^.s to substring? ('lo w')
|
|
132
132
|
assert "expected it to be true that s contains 'lo w'"
|
|
133
133
|
|
|
134
|
+
|
|
135
|
+
#
|
|
136
|
+
# format_for_html: each leading space becomes one (not the
|
|
137
|
+
# plus the space), and it gets the formatted string.
|
|
138
|
+
#
|
|
139
|
+
|
|
140
|
+
tests.string_html [can] :
|
|
141
|
+
|
|
142
|
+
s [string] :
|
|
143
|
+
|
|
144
|
+
leading_spaces_appear_once [test] :
|
|
145
|
+
description [string] : format_for_html turns leading spaces into once, and puts the result in it.
|
|
146
|
+
on_test [script] :
|
|
147
|
+
put ' b' into ^^.s
|
|
148
|
+
tell ^^.s to format_for_html
|
|
149
|
+
eval it = ' b'
|
|
150
|
+
assert "expected it to have the formatted string"
|
|
151
|
+
|
|
152
|
+
eval ^^.s = ' b'
|
|
153
|
+
assert "expected each leading space once, as "
|
|
154
|
+
|
|
155
|
+
inner_spaces_are_kept [test] :
|
|
156
|
+
description [string] : Only leading spaces are converted.
|
|
157
|
+
on_test [script] :
|
|
158
|
+
put ' a b' into ^^.s
|
|
159
|
+
tell ^^.s to format_for_html
|
|
160
|
+
eval ^^.s = ' a b'
|
|
161
|
+
assert "expected the inner space to stay a space"
|
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
tests.verbs.check [can] :
|
|
6
6
|
|
|
7
|
-
c [container] :
|
|
7
|
+
c [container] : has a value
|
|
8
8
|
a [string] : "a"
|
|
9
9
|
t [container] :
|
|
10
|
+
# Children but no simple value: blank? looks at the value only.
|
|
11
|
+
kids [container] :
|
|
12
|
+
a [string] : "a"
|
|
10
13
|
|
|
11
14
|
check_contains [test] :
|
|
12
15
|
description [string] : Check an object for containment
|
|
@@ -31,3 +34,9 @@ tests.verbs.check [can] :
|
|
|
31
34
|
|
|
32
35
|
check ^^.c.a for blank?
|
|
33
36
|
refute "expected a to not be blank"
|
|
37
|
+
|
|
38
|
+
blank_ignores_children [test] :
|
|
39
|
+
description [string] : blank? asks about the simple value only; contains? asks about children
|
|
40
|
+
on_test [script] :
|
|
41
|
+
check ^^.kids for blank?
|
|
42
|
+
assert "expected kids to be blank: it has children but no simple value"
|
|
@@ -10,3 +10,40 @@ tests.verbs.create [can] :
|
|
|
10
10
|
create cx as string : 'hello'
|
|
11
11
|
eval it = 'hello'
|
|
12
12
|
assert "expected it to equal the created value"
|
|
13
|
+
|
|
14
|
+
tests.verbs.create_names [can] :
|
|
15
|
+
|
|
16
|
+
err_fired [bool] : false
|
|
17
|
+
list [can] :
|
|
18
|
+
n [int] : 3
|
|
19
|
+
before [int] : 0
|
|
20
|
+
slot [alias] :
|
|
21
|
+
|
|
22
|
+
on_error [script] :
|
|
23
|
+
put true into ^.err_fired
|
|
24
|
+
|
|
25
|
+
parenthesised_name_is_an_error [test] :
|
|
26
|
+
description [string] : create doesn't compute a name; a parenthesised one is reported and nothing is created.
|
|
27
|
+
expect_errors [bool] : true
|
|
28
|
+
on_test [script] :
|
|
29
|
+
tell ^^.list to count
|
|
30
|
+
put it into ^^.before
|
|
31
|
+
put false into ^^.err_fired
|
|
32
|
+
create ( 'tests.verbs.create_names.list.' + ^^.n ) as string
|
|
33
|
+
eval it = false
|
|
34
|
+
assert "expected it to be false"
|
|
35
|
+
|
|
36
|
+
eval ^^.err_fired = true
|
|
37
|
+
assert "expected a parenthesised name to be an error"
|
|
38
|
+
|
|
39
|
+
tell ^^.list to count
|
|
40
|
+
eval it = ^^.before
|
|
41
|
+
assert "expected nothing to be created"
|
|
42
|
+
|
|
43
|
+
alias_computes_the_name [test] :
|
|
44
|
+
description [string] : The way to create at a computed path: point an alias at it, then create the alias.
|
|
45
|
+
on_test [script] :
|
|
46
|
+
put 'tests.verbs.create_names.list.' + ^^.n into ^^.slot*
|
|
47
|
+
create ^^.slot* as string
|
|
48
|
+
exists? instance tests.verbs.create_names.list.3
|
|
49
|
+
assert "expected the object to be created at the computed path"
|
|
@@ -44,4 +44,37 @@ tests.verbs.exists [can] :
|
|
|
44
44
|
assert "expected instance to exist"
|
|
45
45
|
|
|
46
46
|
exists? instance tests.verbs.exists.instance2
|
|
47
|
-
refute "expected instance to not exist"
|
|
47
|
+
refute "expected instance to not exist"
|
|
48
|
+
any_finds_an_instance [test] :
|
|
49
|
+
description [string] : With no kind, exists? finds an object instance too.
|
|
50
|
+
on_test [script] :
|
|
51
|
+
exists? tests.verbs.exists.instance
|
|
52
|
+
assert "expected exists? with no kind to find the instance"
|
|
53
|
+
|
|
54
|
+
exists? any tests.verbs.exists.instance
|
|
55
|
+
assert "expected exists? any to find the instance"
|
|
56
|
+
|
|
57
|
+
exists? tests.verbs.exists.instance2
|
|
58
|
+
refute "expected a missing instance to not exist"
|
|
59
|
+
|
|
60
|
+
exists? object tests.verbs.exists.instance
|
|
61
|
+
refute "expected object to check for a type, not an instance"
|
|
62
|
+
|
|
63
|
+
tests.verbs.exists_unknown_kind [can] :
|
|
64
|
+
|
|
65
|
+
err_fired [bool] : false
|
|
66
|
+
|
|
67
|
+
on_error [script] :
|
|
68
|
+
put true into ^.err_fired
|
|
69
|
+
|
|
70
|
+
unknown_kind_is_an_error [test] :
|
|
71
|
+
description [string] : A misspelled kind is reported, not answered false.
|
|
72
|
+
expect_errors [bool] : true
|
|
73
|
+
on_test [script] :
|
|
74
|
+
put false into ^^.err_fired
|
|
75
|
+
exists? instanse tests.verbs.exists_unknown_kind
|
|
76
|
+
eval it = false
|
|
77
|
+
assert "expected it to be false"
|
|
78
|
+
|
|
79
|
+
eval ^^.err_fired = true
|
|
80
|
+
assert "expected an unknown kind to be an error"
|
|
@@ -70,6 +70,7 @@ tests.verbs.invoke [can] :
|
|
|
70
70
|
|
|
71
71
|
inline_invoke_error_test [test] :
|
|
72
72
|
description [string] : Inline invoke( ... ) reports an error for an unresolved target, same as the standalone verb.
|
|
73
|
+
expect_errors [bool] : true
|
|
73
74
|
on_test [script] :
|
|
74
75
|
put false into ^^.err_fired
|
|
75
76
|
show invoke( tests.verbs.invoke.no_such_function )
|
|
@@ -23,6 +23,7 @@ tests.verbs.load [can] :
|
|
|
23
23
|
|
|
24
24
|
load_no_args_errors [test] :
|
|
25
25
|
description [string] : load with no arguments fires on_error.
|
|
26
|
+
expect_errors [bool] : true
|
|
26
27
|
on_test [script] :
|
|
27
28
|
put false into ^^.err_fired
|
|
28
29
|
load
|
|
@@ -31,6 +32,7 @@ tests.verbs.load [can] :
|
|
|
31
32
|
|
|
32
33
|
load_missing_file_errors [test] :
|
|
33
34
|
description [string] : load of a file that can't be found fires on_error.
|
|
35
|
+
expect_errors [bool] : true
|
|
34
36
|
on_test [script] :
|
|
35
37
|
put false into ^^.err_fired
|
|
36
38
|
load no_such_file_xyz
|
|
@@ -163,6 +163,7 @@ END
|
|
|
163
163
|
|
|
164
164
|
extracting_a_subtree_spanning_multiple_files_is_an_error [test] :
|
|
165
165
|
description [string] : save {obj} to {path} refuses when obj's own subtree has declarations in more than one file.
|
|
166
|
+
expect_errors [bool] : true
|
|
166
167
|
on_test [script] :
|
|
167
168
|
put false into ^^.err
|
|
168
169
|
tell ^^.f to write ( ^^.fixture )
|
|
@@ -184,6 +185,7 @@ END
|
|
|
184
185
|
|
|
185
186
|
reload_discards_unsaved_changes [test] :
|
|
186
187
|
description [string] : reload throws away edits that were not saved.
|
|
188
|
+
expect_errors [bool] : true
|
|
187
189
|
on_test [script] :
|
|
188
190
|
tell ^^.f to write ( ^^.fixture )
|
|
189
191
|
load /tmp/gloo_save_test.gloo
|
|
@@ -22,6 +22,7 @@ tests.verbs.throw [can] :
|
|
|
22
22
|
|
|
23
23
|
default_message [test] :
|
|
24
24
|
description [string] : bare throw uses the default message and execution continues.
|
|
25
|
+
expect_errors [bool] : true
|
|
25
26
|
on_test [script] :
|
|
26
27
|
put '' into tests.verbs.throw.caught
|
|
27
28
|
eval false
|
|
@@ -35,6 +36,7 @@ tests.verbs.throw [can] :
|
|
|
35
36
|
|
|
36
37
|
custom_message [test] :
|
|
37
38
|
description [string] : throw evaluates its argument as the message.
|
|
39
|
+
expect_errors [bool] : true
|
|
38
40
|
on_test [script] :
|
|
39
41
|
put '' into tests.verbs.throw.caught
|
|
40
42
|
throw 'boom ' + '42'
|
|
@@ -17,3 +17,38 @@ tests.verbs.unload [can] :
|
|
|
17
17
|
tell tests.verbs.unload.temp to unload
|
|
18
18
|
exists? instance tests.verbs.unload.temp
|
|
19
19
|
refute "temp should be gone after unload"
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# The unload verb takes no object: 'unload x' is an error, and nothing
|
|
23
|
+
# is unloaded. (If this ever regressed, it would unload the test run.)
|
|
24
|
+
#
|
|
25
|
+
|
|
26
|
+
tests.verbs.unload_no_object [can] :
|
|
27
|
+
|
|
28
|
+
err_fired [bool] : false
|
|
29
|
+
temp [string] : still here
|
|
30
|
+
|
|
31
|
+
on_error [script] :
|
|
32
|
+
put true into ^.err_fired
|
|
33
|
+
|
|
34
|
+
error_data [can] :
|
|
35
|
+
message [string] :
|
|
36
|
+
backtrace [string] :
|
|
37
|
+
kind [string] :
|
|
38
|
+
location [string] :
|
|
39
|
+
|
|
40
|
+
unload_with_an_object_unloads_nothing [test] :
|
|
41
|
+
description [string] : 'unload x' reports an error, points to 'tell x to unload', and unloads nothing.
|
|
42
|
+
expect_errors [bool] : true
|
|
43
|
+
on_test [script] :
|
|
44
|
+
put false into ^^.err_fired
|
|
45
|
+
unload tests.verbs.unload_no_object.temp
|
|
46
|
+
|
|
47
|
+
eval ^^.err_fired = true
|
|
48
|
+
assert "expected unload with an object to be an error"
|
|
49
|
+
|
|
50
|
+
eval ^^.error_data.message = "unload takes no object, so nothing was unloaded; to unload one object, use tell x to unload."
|
|
51
|
+
assert "expected the error to point to tell x to unload"
|
|
52
|
+
|
|
53
|
+
exists? instance tests.verbs.unload_no_object.temp
|
|
54
|
+
assert "expected temp to still be loaded"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gloo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 7.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Crane
|
|
@@ -318,6 +318,7 @@ files:
|
|
|
318
318
|
- lib/gloo/core/invoker.rb
|
|
319
319
|
- lib/gloo/core/it.rb
|
|
320
320
|
- lib/gloo/core/literal.rb
|
|
321
|
+
- lib/gloo/core/not_found.rb
|
|
321
322
|
- lib/gloo/core/obj.rb
|
|
322
323
|
- lib/gloo/core/obj_finder.rb
|
|
323
324
|
- lib/gloo/core/op.rb
|
|
@@ -446,8 +447,10 @@ files:
|
|
|
446
447
|
- test.gloo/dt/time.test.gloo
|
|
447
448
|
- test.gloo/lang/continuation.test.gloo
|
|
448
449
|
- test.gloo/lang/convert.test.gloo
|
|
450
|
+
- test.gloo/lang/declaration.test.gloo
|
|
449
451
|
- test.gloo/lang/dt_comparisons.test.gloo
|
|
450
452
|
- test.gloo/lang/exceptions.test.gloo
|
|
453
|
+
- test.gloo/lang/failures.test.gloo
|
|
451
454
|
- test.gloo/lang/gloo_sys.test.gloo
|
|
452
455
|
- test.gloo/lang/here.test.gloo
|
|
453
456
|
- test.gloo/lang/it.test.gloo
|