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.
- checksums.yaml +4 -4
- data/CLAUDE.md +13 -0
- data/docs/application.md +9 -0
- data/docs/language_objects.md +78 -0
- data/docs/language_scripting.md +41 -0
- data/docs/objects.md +1 -1
- data/docs/verbs.md +36 -2
- data/lib/VERSION +1 -1
- data/lib/VERSION_NOTES +13 -0
- data/lib/gloo/app/engine.rb +5 -1
- data/lib/gloo/app/log.rb +5 -5
- data/lib/gloo/app/settings.rb +4 -1
- data/lib/gloo/core/obj.rb +60 -1
- data/lib/gloo/core/parser.rb +30 -1
- data/lib/gloo/core/tokens.rb +44 -18
- data/lib/gloo/expr/l_string.rb +8 -4
- data/lib/gloo/objs/basic/script.rb +28 -2
- data/lib/gloo/objs/web/json.rb +4 -1
- data/lib/gloo/persist/comment_buffer.rb +58 -0
- data/lib/gloo/persist/declaration_ledger.rb +61 -0
- data/lib/gloo/persist/disc_mech.rb +15 -2
- data/lib/gloo/persist/file_loader.rb +208 -102
- data/lib/gloo/persist/file_saver.rb +251 -6
- data/lib/gloo/persist/file_storage.rb +10 -4
- data/lib/gloo/persist/indent_stack.rb +90 -0
- data/lib/gloo/persist/line_splitter.rb +18 -3
- data/lib/gloo/persist/persist_man.rb +193 -26
- data/lib/gloo/persist/script_body_collector.rb +102 -0
- data/lib/gloo/persist/shorthand_expander.rb +51 -0
- data/lib/gloo/persist/source/blank_node.rb +27 -0
- data/lib/gloo/persist/source/comment_node.rb +27 -0
- data/lib/gloo/persist/source/directive_node.rb +26 -0
- data/lib/gloo/persist/source/obj_node.rb +91 -0
- data/lib/gloo/persist/source/source_doc.rb +41 -0
- data/lib/gloo/verbs/list.rb +24 -2
- data/lib/gloo/verbs/load.rb +9 -1
- data/lib/gloo/verbs/reload.rb +3 -0
- data/lib/gloo/verbs/save.rb +57 -10
- data/test.gloo/ctrl/each.test.gloo +28 -30
- data/test.gloo/dt/date.test.gloo +69 -71
- data/test.gloo/dt/datetime.test.gloo +55 -57
- data/test.gloo/dt/time.test.gloo +70 -72
- data/test.gloo/lang/continuation.test.gloo +25 -27
- data/test.gloo/lang/convert.test.gloo +50 -52
- data/test.gloo/lang/dt_comparisons.test.gloo +87 -89
- data/test.gloo/lang/exceptions.test.gloo +42 -44
- data/test.gloo/lang/gloo_sys.test.gloo +100 -102
- data/test.gloo/lang/here.test.gloo +32 -34
- data/test.gloo/lang/it.test.gloo +27 -29
- data/test.gloo/lang/literal.test.gloo +55 -57
- data/test.gloo/lang/load_lib_directive.test.gloo +18 -20
- data/test.gloo/lang/naming.test.gloo +28 -30
- data/test.gloo/lang/ops.test.gloo +53 -55
- data/test.gloo/lang/shorthand.test.gloo +27 -0
- data/test.gloo/math/add.test.gloo +40 -42
- data/test.gloo/math/div.test.gloo +23 -25
- data/test.gloo/math/mult.test.gloo +23 -25
- data/test.gloo/math/sub.test.gloo +23 -25
- data/test.gloo/objs/alias.test.gloo +15 -17
- data/test.gloo/objs/bool.test.gloo +54 -56
- data/test.gloo/objs/can.test.gloo +33 -35
- data/test.gloo/objs/cipher.test.gloo +39 -41
- data/test.gloo/objs/decimal.test.gloo +27 -29
- data/test.gloo/objs/erb.test.gloo +47 -49
- data/test.gloo/objs/file.test.gloo +68 -70
- data/test.gloo/objs/function.test.gloo +37 -39
- data/test.gloo/objs/int.test.gloo +54 -56
- data/test.gloo/objs/json.test.gloo +57 -50
- data/test.gloo/objs/obj.test.gloo +68 -48
- data/test.gloo/objs/outline.test.gloo +48 -50
- data/test.gloo/objs/password.test.gloo +34 -36
- data/test.gloo/objs/repeat.test.gloo +42 -44
- data/test.gloo/objs/script.test.gloo +13 -15
- data/test.gloo/objs/string.test.gloo +82 -84
- data/test.gloo/objs/text.test.gloo +90 -92
- data/test.gloo/objs/untyped.test.gloo +36 -38
- data/test.gloo/objs/uri.test.gloo +37 -39
- data/test.gloo/string/str.test.gloo +15 -0
- data/test.gloo/verbs/break.test.gloo +12 -14
- data/test.gloo/verbs/check.test.gloo +22 -24
- data/test.gloo/verbs/context.test.gloo +11 -13
- data/test.gloo/verbs/create.test.gloo +7 -9
- data/test.gloo/verbs/eval.test.gloo +10 -12
- data/test.gloo/verbs/exists.test.gloo +43 -45
- data/test.gloo/verbs/if.test.gloo +8 -10
- data/test.gloo/verbs/invoke.test.gloo +73 -75
- data/test.gloo/verbs/list.test.gloo +21 -23
- data/test.gloo/verbs/load.test.gloo +27 -21
- data/test.gloo/verbs/log.test.gloo +7 -9
- data/test.gloo/verbs/move.test.gloo +12 -14
- data/test.gloo/verbs/put.test.gloo +10 -12
- data/test.gloo/verbs/reload.test.gloo +55 -0
- data/test.gloo/verbs/run.test.gloo +8 -10
- data/test.gloo/verbs/save.test.gloo +111 -0
- data/test.gloo/verbs/show.test.gloo +26 -28
- data/test.gloo/verbs/tell.test.gloo +8 -10
- data/test.gloo/verbs/throw.test.gloo +31 -33
- data/test.gloo/verbs/unless.test.gloo +13 -15
- data/test.gloo/verbs/unload.test.gloo +10 -12
- metadata +14 -1
|
@@ -2,105 +2,103 @@
|
|
|
2
2
|
# Gloo System tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
eval $.platform_wsl? = false
|
|
106
|
-
assert "expected platform_wsl to be false"
|
|
5
|
+
tests.lang.gloo_sys [can] :
|
|
6
|
+
|
|
7
|
+
get_platform_info [test] :
|
|
8
|
+
description [string] : Get the platform info.
|
|
9
|
+
on_test [script] :
|
|
10
|
+
eval $.platform_cpu
|
|
11
|
+
eval it = ''
|
|
12
|
+
refute "expected cpu to not be empty"
|
|
13
|
+
|
|
14
|
+
eval $.platform_os
|
|
15
|
+
eval it = ''
|
|
16
|
+
refute "expected os to not be empty"
|
|
17
|
+
|
|
18
|
+
eval $.platform_version
|
|
19
|
+
eval it = ''
|
|
20
|
+
refute "expected version to not be empty"
|
|
21
|
+
|
|
22
|
+
eval $.platform_mac?
|
|
23
|
+
eval it = ''
|
|
24
|
+
refute "expected mac? to not be empty"
|
|
25
|
+
|
|
26
|
+
get_hostname [test] :
|
|
27
|
+
description [string] : Get the hostname.
|
|
28
|
+
on_test [script] :
|
|
29
|
+
eval $.hostname = ''
|
|
30
|
+
refute "expected hostname to not be empty"
|
|
31
|
+
|
|
32
|
+
get_working_dir [test] :
|
|
33
|
+
description [string] : Get the working directory.
|
|
34
|
+
on_test [script] :
|
|
35
|
+
eval $.working_dir
|
|
36
|
+
eval it = ''
|
|
37
|
+
refute "expected working_dir to not be empty"
|
|
38
|
+
|
|
39
|
+
eval $.working_dir = gloo.working_dir
|
|
40
|
+
assert "expected gloo. and $. to be the same"
|
|
41
|
+
|
|
42
|
+
get_app_dir [test] :
|
|
43
|
+
description [string] : Get the app directory.
|
|
44
|
+
on_test [script] :
|
|
45
|
+
eval $.app
|
|
46
|
+
eval it = ''
|
|
47
|
+
refute "expected app_dir to not be empty"
|
|
48
|
+
|
|
49
|
+
get_user_info [test] :
|
|
50
|
+
description [string] : Get the user directories.
|
|
51
|
+
on_test [script] :
|
|
52
|
+
eval $.user_home
|
|
53
|
+
eval it = ''
|
|
54
|
+
refute "expected user_home to not be empty"
|
|
55
|
+
|
|
56
|
+
eval $.user
|
|
57
|
+
eval it = ''
|
|
58
|
+
refute "expected user to not be empty"
|
|
59
|
+
|
|
60
|
+
get_gloo_dirs [test] :
|
|
61
|
+
description [string] : Get the gloo directories.
|
|
62
|
+
on_test [script] :
|
|
63
|
+
eval $.gloo_home
|
|
64
|
+
eval it = ''
|
|
65
|
+
refute "expected gloo_home to not be empty"
|
|
66
|
+
|
|
67
|
+
eval $.gloo_config
|
|
68
|
+
eval it = ''
|
|
69
|
+
refute "expected gloo_config to not be empty"
|
|
70
|
+
|
|
71
|
+
eval $.gloo_projects
|
|
72
|
+
eval it = ''
|
|
73
|
+
refute "expected gloo_projects to not be empty"
|
|
74
|
+
|
|
75
|
+
eval $.gloo_log
|
|
76
|
+
eval it = ''
|
|
77
|
+
refute "expected gloo_log to not be empty"
|
|
78
|
+
|
|
79
|
+
get_screen_dims [test] :
|
|
80
|
+
description [string] : Get the screen dimensions.
|
|
81
|
+
i [int] :
|
|
82
|
+
on_test [script] :
|
|
83
|
+
put $.screen_lines into ^.i
|
|
84
|
+
eval ^.i > 0
|
|
85
|
+
assert "expected screen_lines to be greater than 0"
|
|
86
|
+
|
|
87
|
+
put $.screen_cols into ^.i
|
|
88
|
+
eval ^.i > 0
|
|
89
|
+
assert "expected screen_cols to be greater than 0"
|
|
90
|
+
|
|
91
|
+
get_platform_os [test] :
|
|
92
|
+
description [string] : Get the platform OS.
|
|
93
|
+
on_test [script] :
|
|
94
|
+
eval $.platform_mac? = true
|
|
95
|
+
assert "expected platform_mac to be true"
|
|
96
|
+
|
|
97
|
+
eval $.platform_windows? = false
|
|
98
|
+
assert "expected platform_windows to be false"
|
|
99
|
+
|
|
100
|
+
eval $.platform_linux? = false
|
|
101
|
+
assert "expected platform_linux to be false"
|
|
102
|
+
|
|
103
|
+
eval $.platform_wsl? = false
|
|
104
|
+
assert "expected platform_wsl to be false"
|
|
@@ -5,37 +5,35 @@
|
|
|
5
5
|
# parent, ^^^ its grandparent, and so on.
|
|
6
6
|
#
|
|
7
7
|
|
|
8
|
-
tests [can] :
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
eval ^^.r3 = 'level 1'
|
|
41
|
-
assert "expected ^^^ to be the grandparent container"
|
|
8
|
+
tests.lang.here [can] :
|
|
9
|
+
|
|
10
|
+
s [string] : level 0
|
|
11
|
+
|
|
12
|
+
r1 [string] :
|
|
13
|
+
r2 [string] :
|
|
14
|
+
r3 [string] :
|
|
15
|
+
|
|
16
|
+
a [can] :
|
|
17
|
+
s [string] : level 1
|
|
18
|
+
b [can] :
|
|
19
|
+
s [string] : level 2
|
|
20
|
+
c [can] :
|
|
21
|
+
s [string] : level 3
|
|
22
|
+
capture [script] :
|
|
23
|
+
put ^.s into tests.lang.here.r1
|
|
24
|
+
put ^^.s into tests.lang.here.r2
|
|
25
|
+
put ^^^.s into tests.lang.here.r3
|
|
26
|
+
|
|
27
|
+
caret_walks_up_the_tree [test] :
|
|
28
|
+
description [string] : ^, ^^, ^^^ resolve relative to the running script's location.
|
|
29
|
+
on_test [script] :
|
|
30
|
+
tell tests.lang.here.a.b.c.capture to run
|
|
31
|
+
|
|
32
|
+
eval ^^.r1 = 'level 3'
|
|
33
|
+
assert "expected ^ to be the script's own container"
|
|
34
|
+
|
|
35
|
+
eval ^^.r2 = 'level 2'
|
|
36
|
+
assert "expected ^^ to be the parent container"
|
|
37
|
+
|
|
38
|
+
eval ^^.r3 = 'level 1'
|
|
39
|
+
assert "expected ^^^ to be the grandparent container"
|
data/test.gloo/lang/it.test.gloo
CHANGED
|
@@ -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
|
-
|
|
12
|
-
|
|
9
|
+
n [int] : 5
|
|
10
|
+
r [string] :
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
eval 10 * 2
|
|
20
|
+
eval it = 20
|
|
21
|
+
assert "expected eval to leave its result in it"
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
put 'hello' into ^^.r
|
|
24
|
+
eval it = 'hello'
|
|
25
|
+
assert "expected put to leave the stored value in it"
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
24
|
-
|
|
21
|
+
exists? object yml
|
|
22
|
+
assert "expected the yaml short name to be registered too"
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
33
|
-
|
|
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
|
-
|
|
10
|
-
|
|
7
|
+
dup [string] : first
|
|
8
|
+
dup [string] : second
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
Alpha [string] : mixed case
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
1 [string] : numeric name
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
string [string] : a type keyword as a name
|
|
15
|
+
put [string] : a verb keyword as a name
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
29
|
+
eval tests.lang.naming.ALPHA = 'mixed case'
|
|
30
|
+
assert "expected upper-case lookup to find 'Alpha'"
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
41
|
-
|
|
38
|
+
eval ^^.string = 'a type keyword as a name'
|
|
39
|
+
assert "expected a type keyword to be usable as a name"
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
eval ^^.put = 'a verb keyword as a name'
|
|
42
|
+
assert "expected a verb keyword to be usable as a name"
|