gloo 7.0 → 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/docs/objects.md +1 -1
- data/lib/VERSION +1 -1
- data/lib/VERSION_NOTES +4 -0
- data/lib/gloo/core/gloo_system.rb +3 -2
- data/lib/gloo/core/obj.rb +2 -1
- 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 +16 -5
- data/test.gloo/lang/exceptions.test.gloo +8 -0
- data/test.gloo/lang/failures.test.gloo +4 -0
- data/test.gloo/lang/gloo_sys.test.gloo +14 -9
- data/test.gloo/lang/it.test.gloo +6 -0
- data/test.gloo/lang/naming.test.gloo +13 -3
- 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 +3 -0
- data/test.gloo/objs/function.test.gloo +1 -0
- data/test.gloo/verbs/check.test.gloo +10 -1
- data/test.gloo/verbs/create.test.gloo +1 -0
- data/test.gloo/verbs/exists.test.gloo +1 -0
- 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 +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e25a56482e8bd18d1a163f23d17e3b52ff9076ce413428b5db010c05787484b6
|
|
4
|
+
data.tar.gz: 4624e10f7d2aaa59c7105eb225806f8e9b7a25d6ac684cf51d83e23e1c060e53
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7373eaefa3d3dad7a24d4f43084237d0b45d78d9a0f0bd5c362e6c6cc4bba15f134ca821cee9119896265ce1359e0c03139753742d583b130f66334e1fbff652
|
|
7
|
+
data.tar.gz: 3c2edd343bd969e51dd6bfaaf5e47ace92f16f0a0e876b310faba30d45d64eb014fddb029d71e889a6aa4b693f1129255bf1be0c6affc424180db35284c08453
|
data/docs/objects.md
CHANGED
|
@@ -4,7 +4,7 @@ Everything in gloo is an object. Strings, numbers, containers, scripts, function
|
|
|
4
4
|
|
|
5
5
|
Gloo ships with a large set of built-in object types, and core libraries and extensions can add more. This page doesn't try to cover them all — it walks through three common ones to get a feel for how objects work. For the complete list of object types, and every message each one supports, use the in-app help: enter `help` (or `?`), then `objects` to list them all, or `object {name}` for detail on one (see Application, Help).
|
|
6
6
|
|
|
7
|
-
An object's **type declares which messages it can receive** — `up` and `trim` for a `string`, `inc` for an `integer`, `run` for a `script`. An object doesn't have to have a type: with none it is `untyped` (short `any`), declared with a bare colon (`slot :`), with `[any]`, or by `create` with no `as`. An untyped object still takes the messages every object understands (`blank?`, `contains?`, `responds_to?`, `doc`, `reload`, `unload`) — just not the type-specific ones. Untyped is the right choice when you only need to hold, compare, or show a value: a generic result slot, a config value passed straight through, or a field whose kind of value changes over its life.
|
|
7
|
+
An object's **type declares which messages it can receive** — `up` and `trim` for a `string`, `inc` for an `integer`, `run` for a `script`. An object doesn't have to have a type: with none it is `untyped` (short `any`), declared with a bare colon (`slot :`), with `[any]`, or by `create` with no `as`. An untyped object still takes the messages every object understands (`blank?`, `contains?`, `responds_to?`, `doc`, `reload`, `unload`) — just not the type-specific ones. Of those, `blank?` asks about the object's simple value only, and `contains?` asks whether it has children: a container with children but no value of its own is blank, and contains. Untyped is the right choice when you only need to hold, compare, or show a value: a generic result slot, a config value passed straight through, or a field whose kind of value changes over its life.
|
|
8
8
|
|
|
9
9
|
**Contents**
|
|
10
10
|
|
data/lib/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
7.0
|
|
1
|
+
7.0.1
|
data/lib/VERSION_NOTES
CHANGED
|
@@ -246,7 +246,7 @@ module Gloo
|
|
|
246
246
|
|
|
247
247
|
# Is the platform Linux?
|
|
248
248
|
def msg_platform_linux?
|
|
249
|
-
return OS.
|
|
249
|
+
return OS.linux?
|
|
250
250
|
end
|
|
251
251
|
|
|
252
252
|
# Is the platform Mac?
|
|
@@ -322,7 +322,8 @@ module Gloo
|
|
|
322
322
|
'platform_windows? — Is the platform Windows?',
|
|
323
323
|
'platform_unix? — Is the platform Unix?',
|
|
324
324
|
'platform_linux? — Is the platform Linux?',
|
|
325
|
-
'platform_mac? — Is the platform Mac?'
|
|
325
|
+
'platform_mac? — Is the platform Mac?',
|
|
326
|
+
'platform_wsl? — Is the platform WSL (Linux on Windows)?'
|
|
326
327
|
],
|
|
327
328
|
:examples => <<~EXAMPLES.strip
|
|
328
329
|
> show gloo.user
|
data/lib/gloo/core/obj.rb
CHANGED
|
@@ -5,15 +5,17 @@
|
|
|
5
5
|
tests.dt.datetime [can] :
|
|
6
6
|
|
|
7
7
|
d [dt] :
|
|
8
|
+
# Only the now test uses this; the others set d, and tests run in random order.
|
|
9
|
+
fresh [dt] :
|
|
8
10
|
|
|
9
11
|
now [test] :
|
|
10
12
|
description [string] : Get the current datetime
|
|
11
13
|
on_test [script] :
|
|
12
|
-
check ^^.
|
|
14
|
+
check ^^.fresh for blank?
|
|
13
15
|
assert "expected new datetime to be blank"
|
|
14
16
|
|
|
15
|
-
tell ^^.
|
|
16
|
-
check ^^.
|
|
17
|
+
tell ^^.fresh to now
|
|
18
|
+
check ^^.fresh for blank?
|
|
17
19
|
refute "expected datetime to not be blank after now"
|
|
18
20
|
|
|
19
21
|
is_today [test] :
|
|
@@ -4,22 +4,33 @@
|
|
|
4
4
|
|
|
5
5
|
tests.lang.declaration [can] :
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
# syntax error
|
|
7
|
+
# A fixture deliberately missing the ']' after its type, loaded inside
|
|
8
|
+
# its test so the syntax error it reports belongs to that test.
|
|
9
|
+
# Loading reads the type as 'int' anyway.
|
|
10
|
+
unclosed_file [file] : /tmp/gloo_declaration_test.gloo
|
|
11
|
+
unclosed_src [text] : BEGIN
|
|
12
|
+
declaration_fixture [container] :
|
|
9
13
|
unclosed [int : 7
|
|
14
|
+
END
|
|
10
15
|
|
|
11
16
|
closed_then_colon [int]: 8
|
|
12
17
|
|
|
13
18
|
type_missing_its_closing_bracket [test] :
|
|
14
19
|
description [string] : a type missing its ']' is still read as that type, with its value.
|
|
20
|
+
expect_errors [bool] : true
|
|
15
21
|
on_test [script] :
|
|
16
|
-
|
|
22
|
+
tell ^^.unclosed_file to write ( ^^.unclosed_src )
|
|
23
|
+
load /tmp/gloo_declaration_test.gloo
|
|
24
|
+
eval declaration_fixture.unclosed = 7
|
|
17
25
|
assert "expected the value 7"
|
|
18
26
|
|
|
19
|
-
put '12' into
|
|
20
|
-
eval
|
|
27
|
+
put '12' into declaration_fixture.unclosed
|
|
28
|
+
eval declaration_fixture.unclosed = 12
|
|
21
29
|
assert "expected it to still be an integer"
|
|
22
30
|
|
|
31
|
+
tell declaration_fixture to unload
|
|
32
|
+
tell ^^.unclosed_file to delete
|
|
33
|
+
|
|
23
34
|
closed_type_followed_by_the_colon [test] :
|
|
24
35
|
description [string] : a ']' followed directly by ':' is a normal declaration.
|
|
25
36
|
on_test [script] :
|
|
@@ -25,6 +25,7 @@ tests.lang.exceptions [can] :
|
|
|
25
25
|
|
|
26
26
|
confirm_throw_fires_on_exception [test] :
|
|
27
27
|
description [string] : Confirm throw fires on_exception and populates exception_data, but does not fire on_error.
|
|
28
|
+
expect_errors [bool] : true
|
|
28
29
|
on_test [script] :
|
|
29
30
|
put false into ^^.exc_fired
|
|
30
31
|
put false into ^^.err_fired
|
|
@@ -42,6 +43,7 @@ tests.lang.exceptions [can] :
|
|
|
42
43
|
|
|
43
44
|
confirm_execution_continues_after_throw [test] :
|
|
44
45
|
description [string] : Confirm execution continues with the next line after a throw.
|
|
46
|
+
expect_errors [bool] : true
|
|
45
47
|
on_test [script] :
|
|
46
48
|
throw "boom"
|
|
47
49
|
eval 2 + 2
|
|
@@ -50,6 +52,7 @@ tests.lang.exceptions [can] :
|
|
|
50
52
|
|
|
51
53
|
confirm_on_error_still_works [test] :
|
|
52
54
|
description [string] : Confirm on_error still fires for a genuine gloo-level error, independent of on_exception.
|
|
55
|
+
expect_errors [bool] : true
|
|
53
56
|
on_test [script] :
|
|
54
57
|
put false into ^^.exc_fired
|
|
55
58
|
put false into ^^.err_fired
|
|
@@ -64,6 +67,7 @@ tests.lang.exceptions [can] :
|
|
|
64
67
|
|
|
65
68
|
confirm_missing_value_fires_on_error [test] :
|
|
66
69
|
description [string] : Using a missing object as a value is a runtime error, but asking whether it exists is not.
|
|
70
|
+
expect_errors [bool] : true
|
|
67
71
|
on_test [script] :
|
|
68
72
|
put false into ^^.err_fired
|
|
69
73
|
exists? instance ^^.no_such_value
|
|
@@ -81,6 +85,7 @@ tests.lang.exceptions [can] :
|
|
|
81
85
|
|
|
82
86
|
confirm_put_of_missing_value_keeps_target [test] :
|
|
83
87
|
description [string] : A put whose value uses a missing object leaves the target unchanged.
|
|
88
|
+
expect_errors [bool] : true
|
|
84
89
|
on_test [script] :
|
|
85
90
|
put 'keep me' into ^^.kept
|
|
86
91
|
put ^^.no_such_value into ^^.kept
|
|
@@ -89,6 +94,7 @@ tests.lang.exceptions [can] :
|
|
|
89
94
|
|
|
90
95
|
confirm_error_kind [test] :
|
|
91
96
|
description [string] : error_data.kind says whether the command couldn't be understood (syntax) or couldn't be done (runtime).
|
|
97
|
+
expect_errors [bool] : true
|
|
92
98
|
on_test [script] :
|
|
93
99
|
nosuchverb
|
|
94
100
|
eval ^^.error_data.kind = 'syntax'
|
|
@@ -100,6 +106,7 @@ tests.lang.exceptions [can] :
|
|
|
100
106
|
|
|
101
107
|
confirm_error_location [test] :
|
|
102
108
|
description [string] : error_data.location names the script and line that failed.
|
|
109
|
+
expect_errors [bool] : true
|
|
103
110
|
on_test [script] :
|
|
104
111
|
show 1
|
|
105
112
|
show ^^.no_such_value
|
|
@@ -110,6 +117,7 @@ tests.lang.exceptions [can] :
|
|
|
110
117
|
|
|
111
118
|
confirm_bad_value_is_a_warning [test] :
|
|
112
119
|
description [string] : A value that isn't really of its type is a warning, not an error; the best guess is used.
|
|
120
|
+
expect_errors [bool] : true
|
|
113
121
|
on_test [script] :
|
|
114
122
|
put false into ^^.err_fired
|
|
115
123
|
put 'x' into ^^.num
|
|
@@ -34,6 +34,7 @@ tests.lang.failures [can] :
|
|
|
34
34
|
|
|
35
35
|
invalid_json_is_an_error [test] :
|
|
36
36
|
description [string] : Pretty-printing invalid JSON fires on_error, not on_exception, and it is false.
|
|
37
|
+
expect_errors [bool] : true
|
|
37
38
|
on_test [script] :
|
|
38
39
|
put false into ^^.err_fired
|
|
39
40
|
put false into ^^.exc_fired
|
|
@@ -52,6 +53,7 @@ tests.lang.failures [can] :
|
|
|
52
53
|
|
|
53
54
|
template_syntax_error_is_an_error [test] :
|
|
54
55
|
description [string] : An erb template with a syntax error is a gloo error, and gloo keeps running.
|
|
56
|
+
expect_errors [bool] : true
|
|
55
57
|
on_test [script] :
|
|
56
58
|
put false into ^^.err_fired
|
|
57
59
|
put false into ^^.exc_fired
|
|
@@ -66,6 +68,7 @@ tests.lang.failures [can] :
|
|
|
66
68
|
|
|
67
69
|
not_a_date_is_an_error [test] :
|
|
68
70
|
description [string] : A date message on a value that isn't a date fires on_error, and it is false.
|
|
71
|
+
expect_errors [bool] : true
|
|
69
72
|
on_test [script] :
|
|
70
73
|
put '' into ^^.d
|
|
71
74
|
put false into ^^.err_fired
|
|
@@ -81,6 +84,7 @@ tests.lang.failures [can] :
|
|
|
81
84
|
|
|
82
85
|
unknown_unit_is_an_error [test] :
|
|
83
86
|
description [string] : Adding an amount with an unknown unit fires on_error, and it is false.
|
|
87
|
+
expect_errors [bool] : true
|
|
84
88
|
on_test [script] :
|
|
85
89
|
put '2026-01-01' into ^^.d
|
|
86
90
|
put false into ^^.err_fired
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
tests.lang.gloo_sys [can] :
|
|
6
6
|
|
|
7
|
+
# How many of the platform_*? checks are true.
|
|
8
|
+
platforms [int] : 0
|
|
9
|
+
|
|
7
10
|
get_platform_info [test] :
|
|
8
11
|
description [string] : Get the platform info.
|
|
9
12
|
on_test [script] :
|
|
@@ -89,16 +92,18 @@ tests.lang.gloo_sys [can] :
|
|
|
89
92
|
assert "expected screen_cols to be greater than 0"
|
|
90
93
|
|
|
91
94
|
get_platform_os [test] :
|
|
92
|
-
description [string] :
|
|
95
|
+
description [string] : Exactly one of mac, windows and linux is true, on any platform.
|
|
93
96
|
on_test [script] :
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
put 0 into ^^.platforms
|
|
98
|
+
|
|
99
|
+
eval $.platform_mac?
|
|
100
|
+
if it then tell ^^.platforms to inc
|
|
96
101
|
|
|
97
|
-
eval $.platform_windows?
|
|
98
|
-
|
|
102
|
+
eval $.platform_windows?
|
|
103
|
+
if it then tell ^^.platforms to inc
|
|
99
104
|
|
|
100
|
-
eval $.platform_linux?
|
|
101
|
-
|
|
105
|
+
eval $.platform_linux?
|
|
106
|
+
if it then tell ^^.platforms to inc
|
|
102
107
|
|
|
103
|
-
eval
|
|
104
|
-
assert "expected
|
|
108
|
+
eval ^^.platforms = 1
|
|
109
|
+
assert "expected exactly one of platform_mac, platform_windows and platform_linux to be true"
|
data/test.gloo/lang/it.test.gloo
CHANGED
|
@@ -59,6 +59,7 @@ tests.lang.it_read_only [can] :
|
|
|
59
59
|
|
|
60
60
|
message_to_it_is_an_error [test] :
|
|
61
61
|
description [string] : Sending it a message reports an error that says what to do instead.
|
|
62
|
+
expect_errors [bool] : true
|
|
62
63
|
on_test [script] :
|
|
63
64
|
put false into ^^.err_fired
|
|
64
65
|
eval 'abc'
|
|
@@ -71,6 +72,7 @@ tests.lang.it_read_only [can] :
|
|
|
71
72
|
|
|
72
73
|
put_into_it_is_an_error [test] :
|
|
73
74
|
description [string] : Putting a value into it is an error.
|
|
75
|
+
expect_errors [bool] : true
|
|
74
76
|
on_test [script] :
|
|
75
77
|
put false into ^^.err_fired
|
|
76
78
|
put 'x' into it
|
|
@@ -105,6 +107,7 @@ tests.lang.it_rule [can] :
|
|
|
105
107
|
|
|
106
108
|
failed_put_sets_it_false [test] :
|
|
107
109
|
description [string] : A put whose value can't be worked out sets it to false and keeps the target.
|
|
110
|
+
expect_errors [bool] : true
|
|
108
111
|
on_test [script] :
|
|
109
112
|
put false into ^^.err_fired
|
|
110
113
|
eval 'before'
|
|
@@ -120,6 +123,7 @@ tests.lang.it_rule [can] :
|
|
|
120
123
|
|
|
121
124
|
put_into_missing_object_sets_it_false [test] :
|
|
122
125
|
description [string] : A put into an object that doesn't exist sets it to false.
|
|
126
|
+
expect_errors [bool] : true
|
|
123
127
|
on_test [script] :
|
|
124
128
|
eval 'before'
|
|
125
129
|
put 'x' into ^^.no_such_target
|
|
@@ -141,6 +145,7 @@ tests.lang.it_rule [can] :
|
|
|
141
145
|
|
|
142
146
|
failed_function_sets_it_false [test] :
|
|
143
147
|
description [string] : A function whose on_invoke fails sets it to false.
|
|
148
|
+
expect_errors [bool] : true
|
|
144
149
|
on_test [script] :
|
|
145
150
|
eval 'before'
|
|
146
151
|
invoke ^^.failing
|
|
@@ -155,6 +160,7 @@ tests.lang.it_rule [can] :
|
|
|
155
160
|
|
|
156
161
|
message_to_missing_object_sets_it_false [test] :
|
|
157
162
|
description [string] : A message that can't be delivered leaves no stale value in it.
|
|
163
|
+
expect_errors [bool] : true
|
|
158
164
|
on_test [script] :
|
|
159
165
|
eval 'stale'
|
|
160
166
|
tell ^^.no_such_obj to get_parent
|
|
@@ -14,9 +14,13 @@ tests.lang.naming [can] :
|
|
|
14
14
|
string [string] : a type keyword as a name
|
|
15
15
|
put [string] : a verb keyword as a name
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
#
|
|
17
|
+
# A fixture with a deliberately nameless object, loaded inside its
|
|
18
|
+
# test so the syntax error it reports belongs to that test.
|
|
19
|
+
nameless_file [file] : /tmp/gloo_naming_test.gloo
|
|
20
|
+
nameless_src [text] : BEGIN
|
|
21
|
+
naming_fixture [container] :
|
|
19
22
|
[string] : no name given
|
|
23
|
+
END
|
|
20
24
|
|
|
21
25
|
first_of_a_duplicate_name_wins [test] :
|
|
22
26
|
description [string] : when two siblings share a name, the path always reaches the first.
|
|
@@ -47,7 +51,13 @@ tests.lang.naming [can] :
|
|
|
47
51
|
|
|
48
52
|
declaration_with_no_name_gets_a_placeholder [test] :
|
|
49
53
|
description [string] : a declaration with no name loads under the placeholder name unnamed_1.
|
|
54
|
+
expect_errors [bool] : true
|
|
50
55
|
on_test [script] :
|
|
51
|
-
|
|
56
|
+
tell ^^.nameless_file to write ( ^^.nameless_src )
|
|
57
|
+
load /tmp/gloo_naming_test.gloo
|
|
58
|
+
eval naming_fixture.unnamed_1 = 'no name given'
|
|
52
59
|
assert "expected the nameless object to be reached as unnamed_1"
|
|
53
60
|
|
|
61
|
+
tell naming_fixture to unload
|
|
62
|
+
tell ^^.nameless_file to delete
|
|
63
|
+
|
|
@@ -28,8 +28,8 @@ tests.math.div [can] :
|
|
|
28
28
|
eval 10.5 / 5 = 2.1
|
|
29
29
|
assert 'expected 10.5 / 5 = 2.1'
|
|
30
30
|
|
|
31
|
-
eval 100.5 /
|
|
32
|
-
assert 'expected 100.5 /
|
|
31
|
+
eval 100.5 / 201 = 0.5
|
|
32
|
+
assert 'expected 100.5 / 201 = 0.5'
|
|
33
33
|
|
|
34
34
|
eval 1.5 / 10.5 = 0.1
|
|
35
35
|
refute 'expected 1.5 / 10.5 != 0.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'
|
|
@@ -92,6 +92,7 @@ tests.objs.can_child [can] :
|
|
|
92
92
|
|
|
93
93
|
value_at_container_child [test] :
|
|
94
94
|
description [string] : child_value_at on a container child is an error, and it is false.
|
|
95
|
+
expect_errors [bool] : true
|
|
95
96
|
on_test [script] :
|
|
96
97
|
tell ^^.list to child_value_at ( 2 )
|
|
97
98
|
eval it = false
|
|
@@ -111,6 +112,7 @@ tests.objs.can_child [can] :
|
|
|
111
112
|
|
|
112
113
|
out_of_range [test] :
|
|
113
114
|
description [string] : An out-of-range index is an error, and it is false.
|
|
115
|
+
expect_errors [bool] : true
|
|
114
116
|
on_test [script] :
|
|
115
117
|
tell ^^.list to child_path_at ( 3 )
|
|
116
118
|
eval it = false
|
|
@@ -126,6 +128,7 @@ tests.objs.can_child [can] :
|
|
|
126
128
|
|
|
127
129
|
random_empty [test] :
|
|
128
130
|
description [string] : random_child_value on an empty container is an error, and it is false.
|
|
131
|
+
expect_errors [bool] : true
|
|
129
132
|
on_test [script] :
|
|
130
133
|
tell ^^.empty to random_child_value
|
|
131
134
|
eval it = false
|
|
@@ -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"
|
|
@@ -24,6 +24,7 @@ tests.verbs.create_names [can] :
|
|
|
24
24
|
|
|
25
25
|
parenthesised_name_is_an_error [test] :
|
|
26
26
|
description [string] : create doesn't compute a name; a parenthesised one is reported and nothing is created.
|
|
27
|
+
expect_errors [bool] : true
|
|
27
28
|
on_test [script] :
|
|
28
29
|
tell ^^.list to count
|
|
29
30
|
put it into ^^.before
|
|
@@ -69,6 +69,7 @@ tests.verbs.exists_unknown_kind [can] :
|
|
|
69
69
|
|
|
70
70
|
unknown_kind_is_an_error [test] :
|
|
71
71
|
description [string] : A misspelled kind is reported, not answered false.
|
|
72
|
+
expect_errors [bool] : true
|
|
72
73
|
on_test [script] :
|
|
73
74
|
put false into ^^.err_fired
|
|
74
75
|
exists? instanse tests.verbs.exists_unknown_kind
|
|
@@ -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'
|
|
@@ -39,6 +39,7 @@ tests.verbs.unload_no_object [can] :
|
|
|
39
39
|
|
|
40
40
|
unload_with_an_object_unloads_nothing [test] :
|
|
41
41
|
description [string] : 'unload x' reports an error, points to 'tell x to unload', and unloads nothing.
|
|
42
|
+
expect_errors [bool] : true
|
|
42
43
|
on_test [script] :
|
|
43
44
|
put false into ^^.err_fired
|
|
44
45
|
unload tests.verbs.unload_no_object.temp
|