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,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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
13
|
+
eval 2 = 3
|
|
14
|
+
refute "expected 2 to not equal 3"
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
eval "hello" = "hello"
|
|
17
|
+
assert "expected 'hello' = 'hello'"
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
eval "hello" = "world"
|
|
20
|
+
refute "expected 'hello' to not equal 'world'"
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
28
|
+
eval 1 != 1
|
|
29
|
+
refute "expected 1 to not equal 1"
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
eval "hello" != "world"
|
|
32
|
+
assert "expected 'hello' != 'world'"
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
eval "hello" != "hello"
|
|
35
|
+
refute "expected 'hello' to not equal 'hello'"
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
46
|
-
|
|
43
|
+
eval 1 > 2
|
|
44
|
+
refute "expected 1 to not be greater than 2"
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
eval 2 > 2
|
|
47
|
+
refute "expected 2 to not be greater than 2"
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
eval 3 >= 2
|
|
50
|
+
assert "expected 3 >= 2"
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
eval 2 >= 3
|
|
53
|
+
refute "expected 2 to not be greater than or equal to 3"
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
eval 2 >= 2
|
|
56
|
+
assert "expected 2 >= 2"
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
67
|
-
|
|
64
|
+
eval 2 < 1
|
|
65
|
+
refute "expected 2 to not be less than 1"
|
|
68
66
|
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
eval 1 < 1
|
|
68
|
+
refute "expected 1 to not be less than 1"
|
|
71
69
|
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
eval 1 <= 2
|
|
71
|
+
assert "expected 1 <= 2"
|
|
74
72
|
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
eval 2 <= 1
|
|
74
|
+
refute "expected 2 to not be less than or equal to 1"
|
|
77
75
|
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
eval 1 <= 1
|
|
77
|
+
assert "expected 1 <= 1"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Nested container shorthand tests
|
|
3
|
+
#
|
|
4
|
+
# A dotted name in a declaration (page.core.title [string] :) creates
|
|
5
|
+
# a container for each prefix segment, then declares the real object
|
|
6
|
+
# under the last one.
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
tests.lang.shorthand [can] :
|
|
10
|
+
|
|
11
|
+
page.core.title [string] : Home
|
|
12
|
+
page.core.count [int] : 3
|
|
13
|
+
|
|
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"
|
|
19
|
+
|
|
20
|
+
check ^^.page for contains?
|
|
21
|
+
assert "expected 'page' to be a real container"
|
|
22
|
+
|
|
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
|
-
|
|
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
|
-
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
13
|
+
eval 20 / 10 = 2
|
|
14
|
+
assert 'expected 20 / 10 = 2'
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
eval 200 / 100 = 2
|
|
17
|
+
assert 'expected 200 / 100 = 2'
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
eval 1 / 3 = 1
|
|
20
|
+
refute 'expected 1 / 3 != 1'
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
28
|
+
eval 10.5 / 5 = 2.1
|
|
29
|
+
assert 'expected 10.5 / 5 = 2.1'
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
eval 100.5 / 200.5 = 0.5
|
|
32
|
+
assert 'expected 100.5 / 200.5 = 0.5'
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
eval 1.5 / 10.5 = 0.1
|
|
35
|
+
refute 'expected 1.5 / 10.5 != 0.1'
|
|
@@ -2,36 +2,34 @@
|
|
|
2
2
|
# Multiplication tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
math [can] :
|
|
7
|
-
mult [can] :
|
|
5
|
+
tests.math.mult [can] :
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
mult_ints [test] :
|
|
8
|
+
description [string] : Multiply two integers
|
|
9
|
+
on_test [script] :
|
|
10
|
+
eval 2 * 3 = 6
|
|
11
|
+
assert 'expected 2 * 3 = 6'
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
eval 10 * 20 = 200
|
|
14
|
+
assert 'expected 10 * 20 = 200'
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
eval 100 * 200 = 20000
|
|
17
|
+
assert 'expected 100 * 200 = 20000'
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
eval 1 * 3 = 1
|
|
20
|
+
refute 'expected 1 * 3 != 1'
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
mult_decimals [test] :
|
|
23
|
+
description [string] : Multiply two decimals
|
|
24
|
+
on_test [script] :
|
|
25
|
+
eval 1.5 * 5.5 = 8.25
|
|
26
|
+
assert 'expected 1.5 * 5.5 = 8.25'
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
eval 10.5 * 20.5 = 214.5
|
|
29
|
+
assert 'expected 10.5 * 20.5 = 214.5'
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
eval 100.5 * 200.5 = 20100.25
|
|
32
|
+
assert 'expected 100.5 * 200.5 = 20100.25'
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
eval 1.5 * 10.5 = 10
|
|
35
|
+
refute 'expected 1.5 * 10.5 != 10'
|
|
@@ -2,36 +2,34 @@
|
|
|
2
2
|
# Subtraction tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
math [can] :
|
|
7
|
-
sub [can] :
|
|
5
|
+
tests.math.sub [can] :
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
sub_ints [test] :
|
|
8
|
+
description [string] : Subtract two integers
|
|
9
|
+
on_test [script] :
|
|
10
|
+
eval 2 - 3 = -1
|
|
11
|
+
assert 'expected 2 - 3 = -1'
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
eval 10 - 20 = -10
|
|
14
|
+
assert 'expected 10 - 20 = -10'
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
eval 100 - 200 = -100
|
|
17
|
+
assert 'expected 100 - 200 = -100'
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
eval 1 - 3 = -1
|
|
20
|
+
refute 'expected 1 - 3 != -1'
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
sub_decimals [test] :
|
|
23
|
+
description [string] : Subtract two decimals
|
|
24
|
+
on_test [script] :
|
|
25
|
+
eval 1.5 - 5.5 = -4
|
|
26
|
+
assert 'expected 1.5 - 5.5 = -4'
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
eval 10.5 - 20.5 = -10
|
|
29
|
+
assert 'expected 10.5 - 20.5 = -10'
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
eval 100.5 - 200.5 = -100
|
|
32
|
+
assert 'expected 100.5 - 200.5 = -100'
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
eval 1.5 - 10.5 = -1
|
|
35
|
+
refute 'expected 1.5 - 10.5 != -1'
|
|
@@ -2,23 +2,21 @@
|
|
|
2
2
|
# Alias tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
objs [can] :
|
|
7
|
-
alias [can] :
|
|
5
|
+
tests.objs.alias [can] :
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
s [string] : hello
|
|
8
|
+
ln [alias] : tests.objs.alias.s
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
follow_alias [test] :
|
|
11
|
+
description [string] : Follow an alias to the target value
|
|
12
|
+
on_test [script] :
|
|
13
|
+
put 'hello' into ^^.s
|
|
14
|
+
eval ^^.ln = 'hello'
|
|
15
|
+
assert "expected alias to resolve to 'hello'"
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
put_via_alias [test] :
|
|
18
|
+
description [string] : Put a value via an alias
|
|
19
|
+
on_test [script] :
|
|
20
|
+
put 'world' into ^^.ln
|
|
21
|
+
eval ^^.s = 'world'
|
|
22
|
+
assert "expected s to be updated via alias"
|
|
@@ -2,59 +2,57 @@
|
|
|
2
2
|
# Boolean 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
|
-
eval ^^.b = false
|
|
60
|
-
assert "expected b to be false"
|
|
5
|
+
tests.objs.bool [can] :
|
|
6
|
+
|
|
7
|
+
a [boolean] :
|
|
8
|
+
b [boolean] :
|
|
9
|
+
|
|
10
|
+
set_value_with_msg [test] :
|
|
11
|
+
description [string] : Set the value of the boolean
|
|
12
|
+
on_test [script] :
|
|
13
|
+
tell ^^.b to true
|
|
14
|
+
assert "expected it to be true"
|
|
15
|
+
|
|
16
|
+
eval ^^.b
|
|
17
|
+
assert "expected b to be true"
|
|
18
|
+
|
|
19
|
+
tell ^^.b to false
|
|
20
|
+
refute "expected it to be false"
|
|
21
|
+
|
|
22
|
+
eval ^^.b
|
|
23
|
+
refute "expected b to be false"
|
|
24
|
+
|
|
25
|
+
not_value [test] :
|
|
26
|
+
description [string] : Set the value of the boolean and not it
|
|
27
|
+
on_test [script] :
|
|
28
|
+
tell ^^.b to true
|
|
29
|
+
tell ^^.b to not
|
|
30
|
+
refute "expected it to be false"
|
|
31
|
+
|
|
32
|
+
tell ^^.b to false
|
|
33
|
+
tell ^^.b to not
|
|
34
|
+
assert "expected it to be true"
|
|
35
|
+
|
|
36
|
+
compare_values [test] :
|
|
37
|
+
description [string] : Compare the value of two booleans
|
|
38
|
+
on_test [script] :
|
|
39
|
+
tell ^^.a to true
|
|
40
|
+
put true into ^^.b
|
|
41
|
+
eval ^^.b = ^^.a
|
|
42
|
+
assert "expected both to be true"
|
|
43
|
+
|
|
44
|
+
tell ^^.a to false
|
|
45
|
+
put false into ^^.b
|
|
46
|
+
eval ^^.b = ^^.a
|
|
47
|
+
assert "expected both to be false"
|
|
48
|
+
|
|
49
|
+
set_value [test] :
|
|
50
|
+
description [string] : Set the value of the boolean
|
|
51
|
+
on_test [script] :
|
|
52
|
+
put true into ^^.b
|
|
53
|
+
eval ^^.b = true
|
|
54
|
+
assert "expected b to be true"
|
|
55
|
+
|
|
56
|
+
put false into ^^.b
|
|
57
|
+
eval ^^.b = false
|
|
58
|
+
assert "expected b to be false"
|