@platforma-sdk/workflow-tengo 2.9.6 → 2.9.8

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 (64) hide show
  1. package/dist/tengo/lib/assets.lib.tengo +52 -52
  2. package/dist/tengo/lib/assets.swinfo.lib.tengo +45 -45
  3. package/dist/tengo/lib/constants.lib.tengo +32 -32
  4. package/dist/tengo/lib/exec.R.internal.lib.tengo +29 -29
  5. package/dist/tengo/lib/exec.R.lib.tengo +166 -166
  6. package/dist/tengo/lib/exec.constants.lib.tengo +4 -4
  7. package/dist/tengo/lib/exec.descriptor.lib.tengo +31 -31
  8. package/dist/tengo/lib/exec.internal.lib.tengo +297 -297
  9. package/dist/tengo/lib/exec.lib.tengo +815 -815
  10. package/dist/tengo/lib/exec.monetization.lib.tengo +130 -130
  11. package/dist/tengo/lib/exec.package.lib.tengo +212 -212
  12. package/dist/tengo/lib/exec.python.internal.lib.tengo +6 -6
  13. package/dist/tengo/lib/exec.python.lib.tengo +146 -146
  14. package/dist/tengo/lib/exec.runcmd.lib.tengo +371 -371
  15. package/dist/tengo/lib/exec.runenv.lib.tengo +92 -92
  16. package/dist/tengo/lib/exec.stream.lib.tengo +40 -40
  17. package/dist/tengo/lib/file.internal.lib.tengo +77 -77
  18. package/dist/tengo/lib/file.lib.tengo +57 -57
  19. package/dist/tengo/lib/ll.lib.tengo +244 -244
  20. package/dist/tengo/lib/maps.lib.tengo +152 -152
  21. package/dist/tengo/lib/objects.lib.tengo +13 -13
  22. package/dist/tengo/lib/oop.lib.tengo +19 -19
  23. package/dist/tengo/lib/path.lib.tengo +125 -125
  24. package/dist/tengo/lib/pframes.constants.lib.tengo +28 -28
  25. package/dist/tengo/lib/pframes.export-pcolumn.lib.tengo +33 -33
  26. package/dist/tengo/lib/pframes.lib.tengo +43 -43
  27. package/dist/tengo/lib/pframes.ll.lib.tengo +72 -72
  28. package/dist/tengo/lib/pframes.pcolumn.lib.tengo +49 -49
  29. package/dist/tengo/lib/pframes.spec.lib.tengo +96 -96
  30. package/dist/tengo/lib/pframes.util.lib.tengo +288 -288
  31. package/dist/tengo/lib/pframes.xsv.lib.tengo +272 -272
  32. package/dist/tengo/lib/render.lib.tengo +75 -75
  33. package/dist/tengo/lib/sets.lib.tengo +68 -68
  34. package/dist/tengo/lib/slices.lib.tengo +258 -155
  35. package/dist/tengo/lib/smart.lib.tengo +1069 -1069
  36. package/dist/tengo/lib/test.lib.tengo +161 -161
  37. package/dist/tengo/lib/tpl.lib.tengo +515 -515
  38. package/dist/tengo/lib/tpl.state-await.lib.tengo +240 -240
  39. package/dist/tengo/lib/tpl.util.lib.tengo +9 -9
  40. package/dist/tengo/lib/validation.lib.tengo +378 -378
  41. package/dist/tengo/lib/workdir.lib.tengo +331 -331
  42. package/dist/tengo/lib/workdir.proc.lib.tengo +144 -144
  43. package/dist/tengo/lib/workdir.save.lib.tengo +130 -130
  44. package/dist/tengo/lib/workflow.bobject.lib.tengo +26 -26
  45. package/dist/tengo/lib/workflow.bquery.lib.tengo +165 -165
  46. package/dist/tengo/lib/workflow.constants.lib.tengo +2 -2
  47. package/dist/tengo/lib/workflow.context.lib.tengo +32 -32
  48. package/dist/tengo/lib/workflow.lib.tengo +206 -206
  49. package/dist/tengo/tpl/exec.R.create-renv.plj.gz +0 -0
  50. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  51. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  52. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  53. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  54. package/dist/tengo/tpl/pframes.aggregate.plj.gz +0 -0
  55. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  56. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  57. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  58. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  59. package/dist/tengo/tpl/pframes.map-pframe.plj.gz +0 -0
  60. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  61. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  62. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  63. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  64. package/package.json +2 -2
@@ -1,204 +1,204 @@
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
1
+ /*
2
+ * Library for tengo unit tests.
3
+ * Contains collection of helpers, that make tengo unit tests more compact, easier for reading and writing.
4
+ *
5
+ * WARNING: It is designed to be imported ONLY in *.test.tengo files.
6
+ * As it works ONLY in tengo unit tests context, it will break any workflow if imported
7
+ * in .lib.tengo or .tpl.tengo file.
8
+ */
9
9
 
10
10
  test := import("test")
11
11
 
12
+ //
13
+ // Basic re-export from "test" builtin library with some conveniences
14
+ //
12
15
 
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
16
+ /**
17
+ * Skip the test writing given message to the console log.
18
+ *
19
+ * @param args: []any - message to be written.
20
+ * Each argument is converted to string with its default formatter.
21
+ */
22
22
  skip := func(...args) {
23
- test.skip(args...)
23
+ test.skip(args...)
24
24
  }
25
25
 
26
-
27
-
28
-
29
-
30
-
31
-
26
+ /**
27
+ * Formatted version of skip(). skipf(msg, ...args) == skip(format(msg, args...))
28
+ *
29
+ * @param msg: string - message with formatting directives.
30
+ * @param args: []any - arguments for directives in <msg>.
31
+ */
32
32
  skipf := func(msg, ...args) {
33
- skip(format(msg, args...))
33
+ skip(format(msg, args...))
34
34
  }
35
35
 
36
-
37
-
38
-
39
-
40
-
41
-
42
-
36
+ /**
37
+ * Fail the test in place. Interrupts execution of single test and prints a
38
+ * failure message to the console log.
39
+ *
40
+ * @param args: []any - message to be written.
41
+ * Each argument is converted to string with its default formatter.
42
+ */
43
43
  fail := func(...args) {
44
- test.fail(args...)
44
+ test.fail(args...)
45
45
  }
46
46
 
47
-
48
-
49
-
50
-
51
-
52
-
47
+ /**
48
+ * Formatted version of fail(). failf(msg, ...args) == fail(format(msg, args...))
49
+ *
50
+ * @param msg: string - message with formatting directives.
51
+ * @param args: []any - arguments for directives in <msg>.
52
+ */
53
53
  failf := func(msg, ...args) {
54
- fail(format(msg, args...))
54
+ fail(format(msg, args...))
55
55
  }
56
56
 
57
-
58
-
59
-
60
-
61
-
62
-
57
+ /**
58
+ * Write message to console log.
59
+ *
60
+ * @param args: []any - message to be written.
61
+ * Each argument is converted to string with its default formatter.
62
+ */
63
63
  log := func(...args) {
64
- test.log(args...)
64
+ test.log(args...)
65
65
  }
66
66
 
67
-
68
-
69
-
70
-
71
-
72
-
67
+ /**
68
+ * Formatted version of log(). logf(msg, ...args) == log(format(msg, args...))
69
+ *
70
+ * @param msg: string - message with formatting directives.
71
+ * @param args: []any - arguments for directives in <msg>.
72
+ */
73
73
  logf := func(msg, ...args) {
74
- test.log(format(msg, args...))
75
- }
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
74
+ test.log(format(msg, args...))
75
+ }
76
+
77
+ /**
78
+ * Mark test as executed for tengo testing engine.
79
+ *
80
+ * Regular tengo file with tests contains bunch of fuctions starting with 'Test' prefix, like `TestMyFunction := func() { ... }`.
81
+ * You DO NOT need to call this Done() method if you have file with Test* functions.
82
+ *
83
+ * For some rare cases, you may want to define your own custom testing script, that will call functions on its own instead
84
+ * of using the standard test functions naming. In this case, testing engine needs to know the difference between "nothing was called at all"
85
+ * and "everything was done well". This is what this method for.
86
+ *
87
+ * You don't need it in 99.9% of cases.
88
+ *
89
+ * This method does not interrupt test execution and is intended for use in custom test scripts
90
+ * without declared test functions.
91
+ */
92
92
  done := func() {
93
- test.done()
93
+ test.done()
94
94
  }
95
95
 
96
+ //
97
+ // Boolean assertions
98
+ //
96
99
 
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
100
+ /**
101
+ * Require <condition> to be true, failing test when not.
102
+ *
103
+ * @param condition: bool
104
+ * @param msg: []any - message to be printed on check failure
105
+ */
106
106
  isTrue := func(condition, ...msg) {
107
- if !condition {
108
- test.fail("<condition> != 'true': ", msg...)
109
- }
110
- }
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
107
+ if !condition {
108
+ test.fail("<condition> != 'true': ", msg...)
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Formatted version of isTrue(). isTruef(condition, msg, ...args) == isTrue(condition, format(msg, args...))
114
+ *
115
+ * @param condition: bool
116
+ * @param msg: string - message with formatting directives to be printed on check failure
117
+ * @param args: []any - arguments for formatting directives in <msg>
118
+ */
119
119
  isTruef := func(condition, msg, ...args) {
120
- isTrue(condition, format(msg, args...))
120
+ isTrue(condition, format(msg, args...))
121
121
  }
122
122
 
123
-
124
-
125
-
126
-
127
-
128
-
123
+ /**
124
+ * Require <condition> to be false, failing test when not.
125
+ *
126
+ * @param condition: bool
127
+ * @param args: []any - message to be printed on check failure
128
+ */
129
129
  isFalse := func(condition, ...args) {
130
- if condition {
131
- test.fail("<condition> != 'false'", args...)
132
- }
133
- }
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
130
+ if condition {
131
+ test.fail("<condition> != 'false'", args...)
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Formatted version of isFalse(). isFalsef(condition, msg, ..args) == isFalse(condition, format(msg, args...))
137
+ *
138
+ * @param condition: bool
139
+ * @param msg: string - message with formatting directives to be printed on check failure
140
+ * @param args: []any - arguments for formatting directives in <msg>
141
+ */
142
142
  isFalsef := func(condition, msg, ...args) {
143
- isFalse(condition, format(msg, args...))
143
+ isFalse(condition, format(msg, args...))
144
144
  }
145
145
 
146
+ //
147
+ // Equality assertions
148
+ //
146
149
 
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
-
150
+ /**
151
+ * Fails test when <expect> != <value>
152
+ *
153
+ * @param expect: any - expected value for the equality check
154
+ * @param value: any - the value to be checked
155
+ * @param args: []any - the message to be printed on check failure
156
+ */
157
157
  isEqual := func(expect, value, ...args) {
158
- if expect == value {
159
- return
160
- }
158
+ if expect == value {
159
+ return
160
+ }
161
161
 
162
- msg := format("%q != %q (expect: %#v, got %#v)", expect, value, expect, value)
162
+ msg := format("%q != %q (expect: %#v, got %#v)", expect, value, expect, value)
163
163
 
164
- fail(msg, args...)
164
+ fail(msg, args...)
165
165
  }
166
166
 
167
-
168
-
169
-
170
-
171
-
172
-
173
-
174
-
167
+ /**
168
+ * Formatted version of isEqual(). isEqualf(expect, value, msg, ..args) == isEqual(expect, value, format(msg, args...))
169
+ *
170
+ * @param expect: any - expected value for the equality check
171
+ * @param value: any - the value to be checked
172
+ * @param msg: string - message with formatting directives to be printed on check failure
173
+ * @param args: []any - arguments for formatting directives in <msg>
174
+ */
175
175
  isEqualf := func(expect, value, msg, ...args) {
176
- isEqual(expect, value, format(msg, args...))
176
+ isEqual(expect, value, format(msg, args...))
177
177
  }
178
178
 
179
179
  export {
180
-
181
-
182
-
183
- done : done,
184
- skip : skip,
185
- skipf : skipf,
186
- fail : fail,
187
- failf : failf,
188
- log : log,
189
- logf : logf,
190
-
191
-
192
-
193
-
194
- isTrue : isTrue,
195
- isTruef : isTruef,
196
- isFalse : isFalse,
197
- isFalsef : isFalsef,
198
-
199
-
200
-
201
-
202
- isEqual : isEqual,
203
- isEqualf : isEqualf
180
+ //
181
+ // Builtin 'test' module method wrappers
182
+ //
183
+ done : done,
184
+ skip : skip,
185
+ skipf : skipf,
186
+ fail : fail,
187
+ failf : failf,
188
+ log : log,
189
+ logf : logf,
190
+
191
+ //
192
+ // Boolean assertions
193
+ //
194
+ isTrue : isTrue,
195
+ isTruef : isTruef,
196
+ isFalse : isFalse,
197
+ isFalsef : isFalsef,
198
+
199
+ //
200
+ // Equality assertions
201
+ //
202
+ isEqual : isEqual,
203
+ isEqualf : isEqualf
204
204
  }