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,88 +2,86 @@
2
2
  # Time tests
3
3
  #
4
4
 
5
- tests [can] :
6
- dt [can] :
7
- time [can] :
5
+ tests.dt.time [can] :
8
6
 
9
- t [time] :
10
- x [time] :
11
- future [time] :
7
+ t [time] :
8
+ x [time] :
9
+ future [time] :
12
10
 
13
- now [test] :
14
- description [string] : Get the current time
15
- on_test [script] :
16
- check ^^.x for blank?
17
- assert "expected new time to be blank"
11
+ now [test] :
12
+ description [string] : Get the current time
13
+ on_test [script] :
14
+ check ^^.x for blank?
15
+ assert "expected new time to be blank"
18
16
 
19
- tell ^^.x to now
20
- check ^^.x for blank?
21
- refute "expected time to not be blank"
17
+ tell ^^.x to now
18
+ check ^^.x for blank?
19
+ refute "expected time to not be blank"
22
20
 
23
- tell ^^.t to now
24
- eval ^^.t = ^^.x
25
- assert "expected times to be equal"
21
+ tell ^^.t to now
22
+ eval ^^.t = ^^.x
23
+ assert "expected times to be equal"
26
24
 
27
- add [test] :
28
- description [string] : Add hours to a time
29
- on_test [script] :
30
- tell ^^.t to now
31
- tell ^^.future to now
32
- tell ^^.future to add
33
- eval ^^.future = ^^.t
34
- refute "expected future time to be after current time"
25
+ add [test] :
26
+ description [string] : Add hours to a time
27
+ on_test [script] :
28
+ tell ^^.t to now
29
+ tell ^^.future to now
30
+ tell ^^.future to add
31
+ eval ^^.future = ^^.t
32
+ refute "expected future time to be after current time"
35
33
 
36
- subtract [test] :
37
- description [string] : Subtract hours from a time
38
- on_test [script] :
39
- tell ^^.t to now
40
- tell ^^.future to now
41
- tell ^^.future to sub
42
- eval ^^.future = ^^.t
43
- refute "expected past time to be before current time"
34
+ subtract [test] :
35
+ description [string] : Subtract hours from a time
36
+ on_test [script] :
37
+ tell ^^.t to now
38
+ tell ^^.future to now
39
+ tell ^^.future to sub
40
+ eval ^^.future = ^^.t
41
+ refute "expected past time to be before current time"
44
42
 
45
- hh [test] :
46
- description [string] : Get the hour portion of a time
47
- on_test [script] :
48
- tell ^^.t to now
49
- tell ^^.t to hh
50
- eval it = ^^.t
51
- refute "expected hour to not be the same as the time"
43
+ hh [test] :
44
+ description [string] : Get the hour portion of a time
45
+ on_test [script] :
46
+ tell ^^.t to now
47
+ tell ^^.t to hh
48
+ eval it = ^^.t
49
+ refute "expected hour to not be the same as the time"
52
50
 
53
- mm [test] :
54
- description [string] : Get the minute portion of a time
55
- on_test [script] :
56
- tell ^^.t to now
57
- tell ^^.t to mm
58
- eval it = ^^.t
59
- refute "expected minute to not be the same as the time"
51
+ mm [test] :
52
+ description [string] : Get the minute portion of a time
53
+ on_test [script] :
54
+ tell ^^.t to now
55
+ tell ^^.t to mm
56
+ eval it = ^^.t
57
+ refute "expected minute to not be the same as the time"
60
58
 
61
- ss [test] :
62
- description [string] : Get the second portion of a time
63
- on_test [script] :
64
- tell ^^.t to now
65
- tell ^^.t to ss
66
- eval it = ^^.t
67
- refute "expected second to not be the same as the time"
59
+ ss [test] :
60
+ description [string] : Get the second portion of a time
61
+ on_test [script] :
62
+ tell ^^.t to now
63
+ tell ^^.t to ss
64
+ eval it = ^^.t
65
+ refute "expected second to not be the same as the time"
68
66
 
69
- am [test] :
70
- description [string] : Get the am/pm portion of a time
71
- on_test [script] :
72
- tell ^^.t to now
73
- tell ^^.t to am
74
- eval it = ^^.t
75
- refute "expected am/pm to not be the same as the time"
67
+ am [test] :
68
+ description [string] : Get the am/pm portion of a time
69
+ on_test [script] :
70
+ tell ^^.t to now
71
+ tell ^^.t to am
72
+ eval it = ^^.t
73
+ refute "expected am/pm to not be the same as the time"
76
74
 
77
- format [test] :
78
- description [string] : Format a time
79
- f [time] :
80
- on_test [script] :
81
- put '2:30:00 PM' into ^.f
82
- tell ^.f to format
83
- eval it = '14:30:00'
84
- assert "expected formatted time to match"
75
+ format [test] :
76
+ description [string] : Format a time
77
+ f [time] :
78
+ on_test [script] :
79
+ put '2:30:00 PM' into ^.f
80
+ tell ^.f to format
81
+ eval it = '14:30:00'
82
+ assert "expected formatted time to match"
85
83
 
86
- tell ^.f to format ('%I:%M %p')
87
- eval it = '02:30 PM'
88
- assert "expected formatted time to match"
84
+ tell ^.f to format ('%I:%M %p')
85
+ eval it = '02:30 PM'
86
+ assert "expected formatted time to match"
89
87
 
@@ -4,36 +4,34 @@
4
4
  # A trailing \ continues a statement on the next line.
5
5
  #
6
6
 
7
- tests [can] :
8
- lang [can] :
9
- continuation [can] :
7
+ tests.lang.continuation [can] :
10
8
 
11
- one [string] : Hello
12
- two [string] : World
13
- joined [string] :
14
- split [string] :
15
- flag [bool] : false
9
+ one [string] : Hello
10
+ two [string] : World
11
+ joined [string] :
12
+ split [string] :
13
+ flag [bool] : false
16
14
 
17
- split_statement_matches_single_line [test] :
18
- description [string] : a statement broken with \ produces the same result as one line.
19
- on_test [script] :
20
- put ^^.one and ' ' and ^^.two into ^^.joined
15
+ split_statement_matches_single_line [test] :
16
+ description [string] : a statement broken with \ produces the same result as one line.
17
+ on_test [script] :
18
+ put ^^.one and ' ' and ^^.two into ^^.joined
21
19
 
22
- put ^^.one and \
23
- ' ' and \
24
- ^^.two into ^^.split
20
+ put ^^.one and \
21
+ ' ' and \
22
+ ^^.two into ^^.split
25
23
 
26
- eval ^^.split = ^^.joined
27
- assert "expected the continued statement to match the single-line one"
24
+ eval ^^.split = ^^.joined
25
+ assert "expected the continued statement to match the single-line one"
28
26
 
29
- eval ^^.split = 'Hello World'
30
- assert "expected the joined value"
27
+ eval ^^.split = 'Hello World'
28
+ assert "expected the joined value"
31
29
 
32
- continuation_in_an_if [test] :
33
- description [string] : \ works inside an if statement.
34
- on_test [script] :
35
- put false into ^^.flag
36
- if ^^.one = 'Hello' \
37
- then put true into ^^.flag
38
- eval ^^.flag = true
39
- assert "expected the continued if to run its then branch"
30
+ continuation_in_an_if [test] :
31
+ description [string] : \ works inside an if statement.
32
+ on_test [script] :
33
+ put false into ^^.flag
34
+ if ^^.one = 'Hello' \
35
+ then put true into ^^.flag
36
+ eval ^^.flag = true
37
+ assert "expected the continued if to run its then branch"
@@ -4,67 +4,65 @@
4
4
  # 'put' converts the value to the target object's type.
5
5
  #
6
6
 
7
- tests [can] :
8
- lang [can] :
9
- convert [can] :
7
+ tests.lang.convert [can] :
10
8
 
11
- i [integer] : 0
12
- d [decimal] : 0
13
- s [string] : x
14
- b [boolean] : false
9
+ i [integer] : 0
10
+ d [decimal] : 0
11
+ s [string] : x
12
+ b [boolean] : false
15
13
 
16
- string_to_number [test] :
17
- description [string] : a string is converted to the leading number for an int or decimal target.
18
- on_test [script] :
19
- put '3 third time' into ^^.i
20
- eval ^^.i = 3
21
- assert "expected the leading integer to be parsed"
14
+ string_to_number [test] :
15
+ description [string] : a string is converted to the leading number for an int or decimal target.
16
+ on_test [script] :
17
+ put '3 third time' into ^^.i
18
+ eval ^^.i = 3
19
+ assert "expected the leading integer to be parsed"
22
20
 
23
- put '3.12 more' into ^^.d
24
- eval ^^.d = 3.12
25
- assert "expected the leading decimal to be parsed"
21
+ put '3.12 more' into ^^.d
22
+ eval ^^.d = 3.12
23
+ assert "expected the leading decimal to be parsed"
26
24
 
27
- put 'notanumber' into ^^.i
28
- eval ^^.i = 0
29
- assert "expected a non-numeric string to convert to 0"
25
+ put 'notanumber' into ^^.i
26
+ eval ^^.i = 0
27
+ assert "expected a non-numeric string to convert to 0"
30
28
 
31
- number_to_number [test] :
32
- description [string] : int and decimal convert to each other; decimal to int truncates.
33
- on_test [script] :
34
- put 5 into ^^.d
35
- eval ^^.d = 5.0
36
- assert "expected the integer to widen to a decimal"
29
+ number_to_number [test] :
30
+ description [string] : int and decimal convert to each other; decimal to int truncates.
31
+ on_test [script] :
32
+ put 5 into ^^.d
33
+ eval ^^.d = 5.0
34
+ assert "expected the integer to widen to a decimal"
37
35
 
38
- put 9.99 into ^^.i
39
- eval ^^.i = 9
40
- assert "expected the decimal to truncate toward zero"
36
+ put 9.99 into ^^.i
37
+ eval ^^.i = 9
38
+ assert "expected the decimal to truncate toward zero"
41
39
 
42
- anything_to_string [test] :
43
- description [string] : a number or boolean put into a string becomes its text form.
44
- on_test [script] :
45
- put 123 into ^^.s
46
- eval ^^.s = '123'
47
- assert "expected the number to become a string"
40
+ anything_to_string [test] :
41
+ description [string] : a number or boolean put into a string becomes its text form.
42
+ on_test [script] :
43
+ put 123 into ^^.s
44
+ eval ^^.s = '123'
45
+ assert "expected the number to become a string"
48
46
 
49
- put true into ^^.s
50
- eval ^^.s = 'true'
51
- assert "expected the boolean to become a string"
47
+ put true into ^^.s
48
+ eval ^^.s = 'true'
49
+ assert "expected the boolean to become a string"
52
50
 
53
- to_boolean [test] :
54
- description [string] : strings (case-insensitive) and numbers convert to a boolean.
55
- on_test [script] :
56
- put 'false' into ^^.b
57
- eval ^^.b = false
58
- assert "expected 'false' to convert to false"
51
+ to_boolean [test] :
52
+ description [string] : strings (case-insensitive) and numbers convert to a boolean.
53
+ on_test [script] :
54
+ put 'false' into ^^.b
55
+ eval ^^.b = false
56
+ assert "expected 'false' to convert to false"
59
57
 
60
- put 'TRUE' into ^^.b
61
- eval ^^.b = true
62
- assert "expected 'TRUE' to convert to true, case-insensitively"
58
+ put 'TRUE' into ^^.b
59
+ eval ^^.b = true
60
+ assert "expected 'TRUE' to convert to true, case-insensitively"
63
61
 
64
- put 0 into ^^.b
65
- eval ^^.b = false
66
- assert "expected 0 to convert to false"
62
+ put 0 into ^^.b
63
+ eval ^^.b = false
64
+ assert "expected 0 to convert to false"
67
65
 
68
- put 42 into ^^.b
69
- eval ^^.b = true
70
- assert "expected a non-zero number to convert to true"
66
+ put 42 into ^^.b
67
+ eval ^^.b = true
68
+ assert "expected a non-zero number to convert to true"
@@ -2,123 +2,121 @@
2
2
  # Date/time/datetime comparison operator tests
3
3
  #
4
4
 
5
- tests [can] :
6
- lang [can] :
7
- dt_comparisons [can] :
5
+ tests.lang.dt_comparisons [can] :
8
6
 
9
- early_date [date] :
10
- late_date [date] :
11
- early_time [time] :
12
- late_time [time] :
13
- early_dt [datetime] :
14
- late_dt [datetime] :
7
+ early_date [date] :
8
+ late_date [date] :
9
+ early_time [time] :
10
+ late_time [time] :
11
+ early_dt [datetime] :
12
+ late_dt [datetime] :
15
13
 
16
- confirm_date_ops [test] :
17
- description [string] : Confirm comparisons between two dates.
18
- on_test [script] :
19
- put '2025.01.01' into ^^.early_date
20
- put '2025.06.01' into ^^.late_date
14
+ confirm_date_ops [test] :
15
+ description [string] : Confirm comparisons between two dates.
16
+ on_test [script] :
17
+ put '2025.01.01' into ^^.early_date
18
+ put '2025.06.01' into ^^.late_date
21
19
 
22
- eval ^^.late_date > ^^.early_date
23
- assert "expected late date to be greater than early date"
20
+ eval ^^.late_date > ^^.early_date
21
+ assert "expected late date to be greater than early date"
24
22
 
25
- eval ^^.early_date < ^^.late_date
26
- assert "expected early date to be less than late date"
23
+ eval ^^.early_date < ^^.late_date
24
+ assert "expected early date to be less than late date"
27
25
 
28
- eval ^^.early_date = ^^.early_date
29
- assert "expected a date to equal itself"
26
+ eval ^^.early_date = ^^.early_date
27
+ assert "expected a date to equal itself"
30
28
 
31
- eval ^^.early_date != ^^.late_date
32
- assert "expected different dates to not be equal"
29
+ eval ^^.early_date != ^^.late_date
30
+ assert "expected different dates to not be equal"
33
31
 
34
- eval ^^.early_date >= ^^.early_date
35
- assert "expected a date to be >= itself"
32
+ eval ^^.early_date >= ^^.early_date
33
+ assert "expected a date to be >= itself"
36
34
 
37
- eval ^^.late_date <= ^^.early_date
38
- refute "expected late date to not be <= early date"
35
+ eval ^^.late_date <= ^^.early_date
36
+ refute "expected late date to not be <= early date"
39
37
 
40
- confirm_time_ops [test] :
41
- description [string] : Confirm comparisons between two times.
42
- on_test [script] :
43
- put '09:00:00 am' into ^^.early_time
44
- put '05:00:00 pm' into ^^.late_time
38
+ confirm_time_ops [test] :
39
+ description [string] : Confirm comparisons between two times.
40
+ on_test [script] :
41
+ put '09:00:00 am' into ^^.early_time
42
+ put '05:00:00 pm' into ^^.late_time
45
43
 
46
- eval ^^.late_time > ^^.early_time
47
- assert "expected late time to be greater than early time"
44
+ eval ^^.late_time > ^^.early_time
45
+ assert "expected late time to be greater than early time"
48
46
 
49
- eval ^^.early_time < ^^.late_time
50
- assert "expected early time to be less than late time"
47
+ eval ^^.early_time < ^^.late_time
48
+ assert "expected early time to be less than late time"
51
49
 
52
- eval ^^.early_time = ^^.early_time
53
- assert "expected a time to equal itself"
50
+ eval ^^.early_time = ^^.early_time
51
+ assert "expected a time to equal itself"
54
52
 
55
- eval ^^.early_time != ^^.late_time
56
- assert "expected different times to not be equal"
53
+ eval ^^.early_time != ^^.late_time
54
+ assert "expected different times to not be equal"
57
55
 
58
- confirm_datetime_ops [test] :
59
- description [string] : Confirm comparisons between two datetimes.
60
- on_test [script] :
61
- put '2025.01.01 09:00:00 am' into ^^.early_dt
62
- put '2025.01.01 05:00:00 pm' into ^^.late_dt
56
+ confirm_datetime_ops [test] :
57
+ description [string] : Confirm comparisons between two datetimes.
58
+ on_test [script] :
59
+ put '2025.01.01 09:00:00 am' into ^^.early_dt
60
+ put '2025.01.01 05:00:00 pm' into ^^.late_dt
63
61
 
64
- eval ^^.late_dt > ^^.early_dt
65
- assert "expected late datetime to be greater than early datetime"
62
+ eval ^^.late_dt > ^^.early_dt
63
+ assert "expected late datetime to be greater than early datetime"
66
64
 
67
- eval ^^.early_dt < ^^.late_dt
68
- assert "expected early datetime to be less than late datetime"
65
+ eval ^^.early_dt < ^^.late_dt
66
+ assert "expected early datetime to be less than late datetime"
69
67
 
70
- eval ^^.early_dt = ^^.early_dt
71
- assert "expected a datetime to equal itself"
68
+ eval ^^.early_dt = ^^.early_dt
69
+ assert "expected a datetime to equal itself"
72
70
 
73
- eval ^^.early_dt != ^^.late_dt
74
- assert "expected different datetimes to not be equal"
71
+ eval ^^.early_dt != ^^.late_dt
72
+ assert "expected different datetimes to not be equal"
75
73
 
76
- confirm_date_vs_datetime [test] :
77
- description [string] : Confirm a date coerces to midnight when compared to a datetime.
78
- on_test [script] :
79
- put '2025.06.01' into ^^.early_date
80
- put '2025.06.01 12:00:00 am' into ^^.early_dt
81
- put '2025.06.01 09:00:00 am' into ^^.late_dt
74
+ confirm_date_vs_datetime [test] :
75
+ description [string] : Confirm a date coerces to midnight when compared to a datetime.
76
+ on_test [script] :
77
+ put '2025.06.01' into ^^.early_date
78
+ put '2025.06.01 12:00:00 am' into ^^.early_dt
79
+ put '2025.06.01 09:00:00 am' into ^^.late_dt
82
80
 
83
- eval ^^.early_date = ^^.early_dt
84
- assert "expected date to equal midnight of the same day"
81
+ eval ^^.early_date = ^^.early_dt
82
+ assert "expected date to equal midnight of the same day"
85
83
 
86
- eval ^^.late_dt > ^^.early_date
87
- assert "expected later datetime to be greater than the date"
84
+ eval ^^.late_dt > ^^.early_date
85
+ assert "expected later datetime to be greater than the date"
88
86
 
89
- confirm_date_vs_time_is_false [test] :
90
- description [string] : Confirm dates and times never compare as equal or ordered.
91
- on_test [script] :
92
- put '2025.06.01' into ^^.early_date
93
- put '09:00:00 am' into ^^.early_time
87
+ confirm_date_vs_time_is_false [test] :
88
+ description [string] : Confirm dates and times never compare as equal or ordered.
89
+ on_test [script] :
90
+ put '2025.06.01' into ^^.early_date
91
+ put '09:00:00 am' into ^^.early_time
94
92
 
95
- eval ^^.early_date > ^^.early_time
96
- refute "expected date > time to be false"
93
+ eval ^^.early_date > ^^.early_time
94
+ refute "expected date > time to be false"
97
95
 
98
- eval ^^.early_date = ^^.early_time
99
- refute "expected date = time to be false"
96
+ eval ^^.early_date = ^^.early_time
97
+ refute "expected date = time to be false"
100
98
 
101
- eval ^^.early_date != ^^.early_time
102
- refute "expected date != time to be false, since they can't be compared"
99
+ eval ^^.early_date != ^^.early_time
100
+ refute "expected date != time to be false, since they can't be compared"
103
101
 
104
- confirm_date_vs_loose_string [test] :
105
- description [string] : Confirm a date can compare against a loosely formatted string.
106
- on_test [script] :
107
- put '2025.06.01' into ^^.late_date
102
+ confirm_date_vs_loose_string [test] :
103
+ description [string] : Confirm a date can compare against a loosely formatted string.
104
+ on_test [script] :
105
+ put '2025.06.01' into ^^.late_date
108
106
 
109
- eval ^^.late_date > "2025-01-01"
110
- assert "expected date to be greater than a loosely parsed earlier date string"
107
+ eval ^^.late_date > "2025-01-01"
108
+ assert "expected date to be greater than a loosely parsed earlier date string"
111
109
 
112
- eval ^^.late_date > "not a date"
113
- refute "expected comparison against an unparseable string to be false"
110
+ eval ^^.late_date > "not a date"
111
+ refute "expected comparison against an unparseable string to be false"
114
112
 
115
- confirm_date_vs_integer_is_false [test] :
116
- description [string] : Confirm a date never compares as equal or ordered against an integer.
117
- on_test [script] :
118
- put '2025.06.01' into ^^.late_date
113
+ confirm_date_vs_integer_is_false [test] :
114
+ description [string] : Confirm a date never compares as equal or ordered against an integer.
115
+ on_test [script] :
116
+ put '2025.06.01' into ^^.late_date
119
117
 
120
- eval ^^.late_date > 5
121
- refute "expected date > integer to be false"
118
+ eval ^^.late_date > 5
119
+ refute "expected date > integer to be false"
122
120
 
123
- eval ^^.late_date = 5
124
- refute "expected date = integer to be false"
121
+ eval ^^.late_date = 5
122
+ refute "expected date = integer to be false"
@@ -2,62 +2,60 @@
2
2
  # Exception handling tests (on_exception / throw)
3
3
  #
4
4
 
5
- tests [can] :
6
- lang [can] :
7
- exceptions [can] :
5
+ tests.lang.exceptions [can] :
8
6
 
9
- exc_fired [bool] : false
10
- err_fired [bool] : false
7
+ exc_fired [bool] : false
8
+ err_fired [bool] : false
11
9
 
12
- on_exception [script] :
13
- put true into ^.exc_fired
10
+ on_exception [script] :
11
+ put true into ^.exc_fired
14
12
 
15
- on_error [script] :
16
- put true into ^.err_fired
13
+ on_error [script] :
14
+ put true into ^.err_fired
17
15
 
18
- exception_data [can] :
19
- message [string] :
20
- backtrace [string] :
16
+ exception_data [can] :
17
+ message [string] :
18
+ backtrace [string] :
21
19
 
22
- error_data [can] :
23
- message [string] :
24
- backtrace [string] :
20
+ error_data [can] :
21
+ message [string] :
22
+ backtrace [string] :
25
23
 
26
- confirm_throw_fires_on_exception [test] :
27
- description [string] : Confirm throw fires on_exception and populates exception_data, but does not fire on_error.
28
- on_test [script] :
29
- put false into ^^.exc_fired
30
- put false into ^^.err_fired
24
+ confirm_throw_fires_on_exception [test] :
25
+ description [string] : Confirm throw fires on_exception and populates exception_data, but does not fire on_error.
26
+ on_test [script] :
27
+ put false into ^^.exc_fired
28
+ put false into ^^.err_fired
31
29
 
32
- throw "test message"
30
+ throw "test message"
33
31
 
34
- eval ^^.exc_fired = true
35
- assert "expected on_exception to have fired"
32
+ eval ^^.exc_fired = true
33
+ assert "expected on_exception to have fired"
36
34
 
37
- eval ^^.err_fired = false
38
- assert "expected on_error to NOT have fired for a thrown exception"
35
+ eval ^^.err_fired = false
36
+ assert "expected on_error to NOT have fired for a thrown exception"
39
37
 
40
- eval ^^.exception_data.message = "test message"
41
- assert "expected exception_data.message to be populated"
38
+ eval ^^.exception_data.message = "test message"
39
+ assert "expected exception_data.message to be populated"
42
40
 
43
- confirm_execution_continues_after_throw [test] :
44
- description [string] : Confirm execution continues with the next line after a throw.
45
- on_test [script] :
46
- throw "boom"
47
- eval 2 + 2
48
- eval it = 4
49
- assert "expected execution to continue after throw"
41
+ confirm_execution_continues_after_throw [test] :
42
+ description [string] : Confirm execution continues with the next line after a throw.
43
+ on_test [script] :
44
+ throw "boom"
45
+ eval 2 + 2
46
+ eval it = 4
47
+ assert "expected execution to continue after throw"
50
48
 
51
- confirm_on_error_still_works [test] :
52
- description [string] : Confirm on_error still fires for a genuine gloo-level error, independent of on_exception.
53
- on_test [script] :
54
- put false into ^^.exc_fired
55
- put false into ^^.err_fired
49
+ confirm_on_error_still_works [test] :
50
+ description [string] : Confirm on_error still fires for a genuine gloo-level error, independent of on_exception.
51
+ on_test [script] :
52
+ put false into ^^.exc_fired
53
+ put false into ^^.err_fired
56
54
 
57
- tell no_such_object_anywhere to run
55
+ tell no_such_object_anywhere to run
58
56
 
59
- eval ^^.err_fired = true
60
- assert "expected on_error to have fired for a bad path"
57
+ eval ^^.err_fired = true
58
+ assert "expected on_error to have fired for a bad path"
61
59
 
62
- eval ^^.exc_fired = false
63
- assert "expected on_exception to NOT have fired for a gloo-level error"
60
+ eval ^^.exc_fired = false
61
+ assert "expected on_exception to NOT have fired for a gloo-level error"