@fincity/kirun-js 1.0.5 → 1.1.2
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.
- package/__tests__/engine/function/system/array/AddFirstTest.ts +13 -12
- package/__tests__/engine/function/system/array/AddTest.ts +11 -11
- package/__tests__/engine/function/system/array/BinarySearchTest.ts +29 -14
- package/__tests__/engine/function/system/array/CompareTest.ts +3 -3
- package/__tests__/engine/function/system/array/CopyTest.ts +5 -5
- package/__tests__/engine/function/system/array/DeleteFirstTest.ts +10 -10
- package/__tests__/engine/function/system/array/DeleteFromTest.ts +8 -8
- package/__tests__/engine/function/system/array/DeleteLastTest.ts +10 -10
- package/__tests__/engine/function/system/array/DeleteTest.ts +60 -25
- package/__tests__/engine/function/system/array/DisjointTest.ts +6 -7
- package/__tests__/engine/function/system/array/Equals.ts +5 -5
- package/__tests__/engine/function/system/array/FillTest.ts +5 -5
- package/__tests__/engine/function/system/array/FrequencyTest.ts +11 -11
- package/__tests__/engine/function/system/array/IndexOfArrayTest.ts +14 -20
- package/__tests__/engine/function/system/array/IndexOfTest.ts +26 -14
- package/__tests__/engine/function/system/array/InsertTest.ts +12 -12
- package/__tests__/engine/function/system/array/LastIndexOfArrayTest.ts +9 -12
- package/__tests__/engine/function/system/array/LastIndexOfTest.ts +16 -16
- package/__tests__/engine/function/system/array/MaxTest.ts +18 -18
- package/__tests__/engine/function/system/array/MinTest.ts +18 -18
- package/__tests__/engine/function/system/array/MisMatchTest.ts +8 -11
- package/__tests__/engine/function/system/array/ReverseTest.ts +12 -12
- package/__tests__/engine/function/system/array/RotateTest.ts +6 -6
- package/__tests__/engine/function/system/array/ShuffleTest.ts +7 -4
- package/__tests__/engine/function/system/array/SortTest.ts +10 -10
- package/__tests__/engine/function/system/array/SubArrayTest.ts +19 -10
- package/__tests__/engine/function/system/context/SetFunctionTest.ts +24 -5
- package/__tests__/engine/function/system/math/AddTest.ts +2 -2
- package/__tests__/engine/function/system/math/RandomIntTest.ts +46 -0
- package/__tests__/engine/function/system/string/ConcatenateTest.ts +4 -4
- package/__tests__/engine/function/system/string/DeleteForGivenLengthTest.ts +8 -4
- package/__tests__/engine/function/system/string/InsertAtGivenPositionTest.ts +6 -6
- package/__tests__/engine/function/system/string/PostPadTest.ts +6 -6
- package/__tests__/engine/function/system/string/PrePadTest.ts +8 -8
- package/__tests__/engine/function/system/string/RegionMatchesTest.ts +15 -6
- package/__tests__/engine/function/system/string/ReverseTest.ts +6 -6
- package/__tests__/engine/function/system/string/SplitTest.ts +8 -4
- package/__tests__/engine/function/system/string/StringFunctionRepoTest2.ts +35 -11
- package/__tests__/engine/function/system/string/StringFunctionRepoTest3.ts +14 -5
- package/__tests__/engine/function/system/string/StringFunctionRepositoryTest.ts +40 -16
- package/__tests__/engine/function/system/string/ToStringTest.ts +6 -6
- package/__tests__/engine/function/system/string/TrimToTest.ts +8 -6
- package/__tests__/engine/runtime/KIRuntimeTest.ts +148 -155
- package/__tests__/engine/runtime/KIRuntimeWithDefinitionTest.ts +89 -0
- package/__tests__/engine/util/LinkedListTest.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +267 -109
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/engine/function/AbstractFunction.ts +5 -3
- package/src/engine/function/Function.ts +1 -1
- package/src/engine/function/system/GenerateEvent.ts +1 -1
- package/src/engine/function/system/If.ts +1 -1
- package/src/engine/function/system/array/AbstractArrayFunction.ts +5 -0
- package/src/engine/function/system/array/Add.ts +1 -1
- package/src/engine/function/system/array/AddFirst.ts +1 -1
- package/src/engine/function/system/array/BinarySearch.ts +1 -1
- package/src/engine/function/system/array/Compare.ts +1 -1
- package/src/engine/function/system/array/Copy.ts +1 -1
- package/src/engine/function/system/array/Delete.ts +24 -32
- package/src/engine/function/system/array/DeleteFirst.ts +1 -1
- package/src/engine/function/system/array/DeleteFrom.ts +1 -1
- package/src/engine/function/system/array/DeleteLast.ts +1 -1
- package/src/engine/function/system/array/Disjoint.ts +1 -1
- package/src/engine/function/system/array/Equals.ts +2 -2
- package/src/engine/function/system/array/Fill.ts +1 -1
- package/src/engine/function/system/array/Frequency.ts +1 -1
- package/src/engine/function/system/array/IndexOf.ts +1 -1
- package/src/engine/function/system/array/IndexOfArray.ts +1 -1
- package/src/engine/function/system/array/Insert.ts +1 -1
- package/src/engine/function/system/array/LastIndexOf.ts +1 -1
- package/src/engine/function/system/array/LastIndexOfArray.ts +1 -1
- package/src/engine/function/system/array/Max.ts +1 -1
- package/src/engine/function/system/array/Min.ts +1 -1
- package/src/engine/function/system/array/MisMatch.ts +1 -1
- package/src/engine/function/system/array/Reverse.ts +1 -1
- package/src/engine/function/system/array/Rotate.ts +1 -1
- package/src/engine/function/system/array/Shuffle.ts +1 -1
- package/src/engine/function/system/array/Sort.ts +1 -1
- package/src/engine/function/system/array/SubArray.ts +1 -1
- package/src/engine/function/system/context/Create.ts +1 -1
- package/src/engine/function/system/context/Get.ts +1 -1
- package/src/engine/function/system/context/SetFunction.ts +1 -1
- package/src/engine/function/system/loop/CountLoop.ts +1 -1
- package/src/engine/function/system/loop/RangeLoop.ts +1 -1
- package/src/engine/function/system/math/Add.ts +2 -4
- package/src/engine/function/system/math/GenericMathFunction.ts +2 -4
- package/src/engine/function/system/math/Hypotenuse.ts +2 -6
- package/src/engine/function/system/math/Maximum.ts +2 -4
- package/src/engine/function/system/math/Minimum.ts +2 -4
- package/src/engine/function/system/math/Random.ts +1 -1
- package/src/engine/function/system/math/RandomFloat.ts +56 -0
- package/src/engine/function/system/math/RandomInt.ts +56 -0
- package/src/engine/function/system/string/AbstractStringFunction.ts +24 -8
- package/src/engine/function/system/string/Concatenate.ts +2 -2
- package/src/engine/function/system/string/DeleteForGivenLength.ts +25 -15
- package/src/engine/function/system/string/InsertAtGivenPosition.ts +17 -7
- package/src/engine/function/system/string/PostPad.ts +20 -10
- package/src/engine/function/system/string/PrePad.ts +17 -7
- package/src/engine/function/system/string/RegionMatches.ts +40 -22
- package/src/engine/function/system/string/ReplaceAtGivenPosition.ts +26 -13
- package/src/engine/function/system/string/Reverse.ts +4 -3
- package/src/engine/function/system/string/Split.ts +13 -4
- package/src/engine/function/system/string/ToString.ts +9 -5
- package/src/engine/function/system/string/TrimTo.ts +13 -6
- package/src/engine/json/schema/Schema.ts +1 -0
- package/src/engine/model/Event.ts +15 -0
- package/src/engine/model/FunctionDefinition.ts +76 -29
- package/src/engine/model/Parameter.ts +11 -0
- package/src/engine/model/ParameterReference.ts +8 -1
- package/src/engine/model/Position.ts +5 -0
- package/src/engine/model/Statement.ts +16 -0
- package/src/engine/model/StatementGroup.ts +7 -0
- package/src/engine/runtime/KIRuntime.ts +26 -24
- package/src/index.ts +71 -20
|
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
|
|
|
3
3
|
|
|
4
4
|
let larr: LastIndexOfArray = new LastIndexOfArray();
|
|
5
5
|
|
|
6
|
-
test('Last Index of array Test 1', () => {
|
|
6
|
+
test('Last Index of array Test 1', async () => {
|
|
7
7
|
let array: string[] = [];
|
|
8
8
|
|
|
9
9
|
array.push('a');
|
|
@@ -32,15 +32,14 @@ test('Last Index of array Test 1', () => {
|
|
|
32
32
|
]),
|
|
33
33
|
);
|
|
34
34
|
expect(
|
|
35
|
-
larr
|
|
36
|
-
.execute(fep)
|
|
35
|
+
(await larr.execute(fep))
|
|
37
36
|
.allResults()[0]
|
|
38
37
|
.getResult()
|
|
39
38
|
.get(LastIndexOfArray.EVENT_RESULT_INTEGER.getName()),
|
|
40
39
|
).toBe(9);
|
|
41
40
|
});
|
|
42
41
|
|
|
43
|
-
test('last index of array test 2', () => {
|
|
42
|
+
test('last index of array test 2', async () => {
|
|
44
43
|
let arr: any[] = [];
|
|
45
44
|
arr.push('b');
|
|
46
45
|
arr.push('c');
|
|
@@ -67,15 +66,14 @@ test('last index of array test 2', () => {
|
|
|
67
66
|
);
|
|
68
67
|
|
|
69
68
|
expect(
|
|
70
|
-
larr
|
|
71
|
-
.execute(fep)
|
|
69
|
+
(await larr.execute(fep))
|
|
72
70
|
.allResults()[0]
|
|
73
71
|
.getResult()
|
|
74
72
|
.get(LastIndexOfArray.EVENT_RESULT_INTEGER.getName()),
|
|
75
73
|
).toBe(-1);
|
|
76
74
|
});
|
|
77
75
|
|
|
78
|
-
test('last index of array test 3', () => {
|
|
76
|
+
test('last index of array test 3', async () => {
|
|
79
77
|
let arr: any[] = [];
|
|
80
78
|
arr.push('a');
|
|
81
79
|
arr.push('b');
|
|
@@ -98,7 +96,7 @@ test('last index of array test 3', () => {
|
|
|
98
96
|
]),
|
|
99
97
|
);
|
|
100
98
|
|
|
101
|
-
expect(
|
|
99
|
+
await expect(larr.execute(fep)).rejects.toThrow();
|
|
102
100
|
|
|
103
101
|
let fep1: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
104
102
|
new Map<string, any>([
|
|
@@ -108,10 +106,10 @@ test('last index of array test 3', () => {
|
|
|
108
106
|
]),
|
|
109
107
|
);
|
|
110
108
|
|
|
111
|
-
expect(
|
|
109
|
+
await expect(larr.execute(fep1)).rejects.toThrow();
|
|
112
110
|
});
|
|
113
111
|
|
|
114
|
-
test('last index of array test 4', () => {
|
|
112
|
+
test('last index of array test 4', async () => {
|
|
115
113
|
let array1: any[] = [];
|
|
116
114
|
|
|
117
115
|
array1.push('test');
|
|
@@ -204,8 +202,7 @@ test('last index of array test 4', () => {
|
|
|
204
202
|
);
|
|
205
203
|
|
|
206
204
|
expect(
|
|
207
|
-
larr
|
|
208
|
-
.execute(fep)
|
|
205
|
+
(await larr.execute(fep))
|
|
209
206
|
.allResults()[0]
|
|
210
207
|
.getResult()
|
|
211
208
|
.get(LastIndexOfArray.EVENT_RESULT_INTEGER.getName()),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LastIndexOf } from '../../../../../src/engine/function/system/array/LastIndexOf';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
3
|
|
|
4
|
-
test('Last Index of Test 1', () => {
|
|
4
|
+
test('Last Index of Test 1', async () => {
|
|
5
5
|
let lind: LastIndexOf = new LastIndexOf();
|
|
6
6
|
|
|
7
7
|
let array: string[] = [];
|
|
@@ -33,15 +33,14 @@ test('Last Index of Test 1', () => {
|
|
|
33
33
|
]),
|
|
34
34
|
);
|
|
35
35
|
expect(
|
|
36
|
-
lind
|
|
37
|
-
.execute(fep)
|
|
36
|
+
(await lind.execute(fep))
|
|
38
37
|
.allResults()[0]
|
|
39
38
|
.getResult()
|
|
40
39
|
.get(LastIndexOf.EVENT_RESULT_INTEGER.getName()),
|
|
41
40
|
).toBe(13);
|
|
42
41
|
});
|
|
43
42
|
|
|
44
|
-
test('Last Index of Test 2', () => {
|
|
43
|
+
test('Last Index of Test 2', async () => {
|
|
45
44
|
let lind: LastIndexOf = new LastIndexOf();
|
|
46
45
|
|
|
47
46
|
let array: string[] = [];
|
|
@@ -72,10 +71,10 @@ test('Last Index of Test 2', () => {
|
|
|
72
71
|
[LastIndexOf.PARAMETER_INT_FIND_FROM.getParameterName(), 2],
|
|
73
72
|
]),
|
|
74
73
|
);
|
|
75
|
-
expect(
|
|
74
|
+
await expect(lind.execute(fep)).rejects.toThrow();
|
|
76
75
|
});
|
|
77
76
|
|
|
78
|
-
test('Last Index of Test 3', () => {
|
|
77
|
+
test('Last Index of Test 3', async () => {
|
|
79
78
|
let lind: LastIndexOf = new LastIndexOf();
|
|
80
79
|
|
|
81
80
|
let array: string[] = [];
|
|
@@ -106,10 +105,10 @@ test('Last Index of Test 3', () => {
|
|
|
106
105
|
[LastIndexOf.PARAMETER_INT_FIND_FROM.getParameterName(), 2],
|
|
107
106
|
]),
|
|
108
107
|
);
|
|
109
|
-
expect(
|
|
108
|
+
await expect(lind.execute(fep)).rejects.toThrow();
|
|
110
109
|
});
|
|
111
110
|
|
|
112
|
-
test('Last Index of Test 4', () => {
|
|
111
|
+
test('Last Index of Test 4', async () => {
|
|
113
112
|
let lind: LastIndexOf = new LastIndexOf();
|
|
114
113
|
|
|
115
114
|
let array: string[] = [];
|
|
@@ -141,8 +140,7 @@ test('Last Index of Test 4', () => {
|
|
|
141
140
|
]),
|
|
142
141
|
);
|
|
143
142
|
expect(
|
|
144
|
-
lind
|
|
145
|
-
.execute(fep)
|
|
143
|
+
(await lind.execute(fep))
|
|
146
144
|
.allResults()[0]
|
|
147
145
|
.getResult()
|
|
148
146
|
.get(LastIndexOf.EVENT_RESULT_INTEGER.getName()),
|
|
@@ -156,15 +154,14 @@ test('Last Index of Test 4', () => {
|
|
|
156
154
|
]),
|
|
157
155
|
);
|
|
158
156
|
expect(
|
|
159
|
-
lind
|
|
160
|
-
.execute(fep)
|
|
157
|
+
(await lind.execute(fep))
|
|
161
158
|
.allResults()[0]
|
|
162
159
|
.getResult()
|
|
163
160
|
.get(LastIndexOf.EVENT_RESULT_INTEGER.getName()),
|
|
164
161
|
).toBe(-1);
|
|
165
162
|
});
|
|
166
163
|
|
|
167
|
-
test('Last Index of Test 5', () => {
|
|
164
|
+
test('Last Index of Test 5', async () => {
|
|
168
165
|
let lind: LastIndexOf = new LastIndexOf();
|
|
169
166
|
|
|
170
167
|
let array: string[] = [];
|
|
@@ -195,10 +192,10 @@ test('Last Index of Test 5', () => {
|
|
|
195
192
|
[LastIndexOf.PARAMETER_INT_FIND_FROM.getParameterName(), -2],
|
|
196
193
|
]),
|
|
197
194
|
);
|
|
198
|
-
expect(
|
|
195
|
+
await expect(lind.execute(fep)).rejects.toThrow();
|
|
199
196
|
});
|
|
200
197
|
|
|
201
|
-
test('Last Index of Test 6', () => {
|
|
198
|
+
test('Last Index of Test 6', async () => {
|
|
202
199
|
let lind: LastIndexOf = new LastIndexOf();
|
|
203
200
|
|
|
204
201
|
let arr: any[] = [];
|
|
@@ -248,6 +245,9 @@ test('Last Index of Test 6', () => {
|
|
|
248
245
|
]),
|
|
249
246
|
);
|
|
250
247
|
expect(
|
|
251
|
-
lind.execute(fep)
|
|
248
|
+
(await lind.execute(fep))
|
|
249
|
+
.allResults()[0]
|
|
250
|
+
.getResult()
|
|
251
|
+
.get(LastIndexOf.EVENT_RESULT_EMPTY.getName()),
|
|
252
252
|
).toBe(4);
|
|
253
253
|
});
|
|
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
|
|
|
3
3
|
|
|
4
4
|
let max: Max = new Max();
|
|
5
5
|
|
|
6
|
-
test('max test 1 ', () => {
|
|
6
|
+
test('max test 1 ', async () => {
|
|
7
7
|
let arr: any[] = [];
|
|
8
8
|
arr.push(null);
|
|
9
9
|
arr.push(12);
|
|
@@ -12,22 +12,22 @@ test('max test 1 ', () => {
|
|
|
12
12
|
new Map([[Max.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr]]),
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
expect(
|
|
16
|
-
|
|
17
|
-
);
|
|
15
|
+
expect(
|
|
16
|
+
(await max.execute(fep)).allResults()[0].getResult().get(Max.EVENT_RESULT_ANY.getName()),
|
|
17
|
+
).toBe(12);
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
test('max test 2 ', () => {
|
|
20
|
+
test('max test 2 ', async () => {
|
|
21
21
|
let arr: any[] = [];
|
|
22
22
|
|
|
23
23
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
24
24
|
new Map([[Max.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr]]),
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
-
expect(
|
|
27
|
+
await expect(max.execute(fep)).rejects.toThrow();
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
test('max test 3', () => {
|
|
30
|
+
test('max test 3', async () => {
|
|
31
31
|
let arr: any[] = [];
|
|
32
32
|
arr.push(12);
|
|
33
33
|
arr.push(15);
|
|
@@ -38,10 +38,10 @@ test('max test 3', () => {
|
|
|
38
38
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
39
39
|
new Map([[Max.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr]]),
|
|
40
40
|
);
|
|
41
|
-
expect(max.execute(fep).allResults()[0].getResult().get('output')).toBe(98);
|
|
41
|
+
expect((await max.execute(fep)).allResults()[0].getResult().get('output')).toBe(98);
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
test('Max test 4', () => {
|
|
44
|
+
test('Max test 4', async () => {
|
|
45
45
|
let arr: any[] = [];
|
|
46
46
|
arr.push('nocode');
|
|
47
47
|
arr.push('NoCode');
|
|
@@ -49,17 +49,17 @@ test('Max test 4', () => {
|
|
|
49
49
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
50
50
|
new Map([[Max.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr]]),
|
|
51
51
|
);
|
|
52
|
-
expect(max.execute(fep).allResults()[0].getResult().get('output')).toBe('platform');
|
|
52
|
+
expect((await max.execute(fep)).allResults()[0].getResult().get('output')).toBe('platform');
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
test('Max test 6', () => {
|
|
55
|
+
test('Max test 6', async () => {
|
|
56
56
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
57
57
|
new Map([[Max.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), null]]),
|
|
58
58
|
);
|
|
59
|
-
expect(
|
|
59
|
+
await expect(max.execute(fep)).rejects.toThrow();
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
test('Max test 5', () => {
|
|
62
|
+
test('Max test 5', async () => {
|
|
63
63
|
let arr: any[] = [];
|
|
64
64
|
|
|
65
65
|
arr.push(456);
|
|
@@ -72,10 +72,10 @@ test('Max test 5', () => {
|
|
|
72
72
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
73
73
|
new Map([[Max.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr]]),
|
|
74
74
|
);
|
|
75
|
-
expect(max.execute(fep).allResults()[0].getResult().get('output')).toBe('platform');
|
|
75
|
+
expect((await max.execute(fep)).allResults()[0].getResult().get('output')).toBe('platform');
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
test('Max test 7', () => {
|
|
78
|
+
test('Max test 7', async () => {
|
|
79
79
|
let arr1: any[] = [];
|
|
80
80
|
arr1.push('c');
|
|
81
81
|
arr1.push('r');
|
|
@@ -85,14 +85,14 @@ test('Max test 7', () => {
|
|
|
85
85
|
new Map([[Max.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr1]]),
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
-
expect(max.execute(fep).allResults()[0].getResult().get('output')).toBe('s');
|
|
88
|
+
expect((await max.execute(fep)).allResults()[0].getResult().get('output')).toBe('s');
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
test('Max test 8', () => {
|
|
91
|
+
test('Max test 8', async () => {
|
|
92
92
|
let arr: any[] = ['surendhar'];
|
|
93
93
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
94
94
|
new Map([[Max.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr]]),
|
|
95
95
|
);
|
|
96
96
|
|
|
97
|
-
expect(max.execute(fep).allResults()[0].getResult().get('output')).toBe('surendhar');
|
|
97
|
+
expect((await max.execute(fep)).allResults()[0].getResult().get('output')).toBe('surendhar');
|
|
98
98
|
});
|
|
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
|
|
|
3
3
|
|
|
4
4
|
let min: Min = new Min();
|
|
5
5
|
|
|
6
|
-
test('min test 1 ', () => {
|
|
6
|
+
test('min test 1 ', async () => {
|
|
7
7
|
let arr: any[] = [];
|
|
8
8
|
arr.push(null);
|
|
9
9
|
arr.push(12);
|
|
@@ -12,22 +12,22 @@ test('min test 1 ', () => {
|
|
|
12
12
|
new Map([[Min.PARAMETER_ARRAY_SOURCE.getParameterName(), arr]]),
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
expect(
|
|
16
|
-
|
|
17
|
-
);
|
|
15
|
+
expect(
|
|
16
|
+
(await min.execute(fep)).allResults()[0].getResult().get(Min.EVENT_RESULT_ANY.getName()),
|
|
17
|
+
).toBe(12);
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
test('min test 2 ', () => {
|
|
20
|
+
test('min test 2 ', async () => {
|
|
21
21
|
let arr: any[] = [];
|
|
22
22
|
|
|
23
23
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
24
24
|
new Map([[Min.PARAMETER_ARRAY_SOURCE.getParameterName(), arr]]),
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
-
expect(
|
|
27
|
+
await expect(min.execute(fep)).rejects.toThrow();
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
test('min test 3', () => {
|
|
30
|
+
test('min test 3', async () => {
|
|
31
31
|
let arr: any[] = [];
|
|
32
32
|
arr.push(12);
|
|
33
33
|
arr.push(15);
|
|
@@ -38,10 +38,10 @@ test('min test 3', () => {
|
|
|
38
38
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
39
39
|
new Map([[Min.PARAMETER_ARRAY_SOURCE.getParameterName(), arr]]),
|
|
40
40
|
);
|
|
41
|
-
expect(min.execute(fep).allResults()[0].getResult().get('output')).toBe(1);
|
|
41
|
+
expect((await min.execute(fep)).allResults()[0].getResult().get('output')).toBe(1);
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
test('min test 4', () => {
|
|
44
|
+
test('min test 4', async () => {
|
|
45
45
|
let arr: any[] = [];
|
|
46
46
|
arr.push('nocode');
|
|
47
47
|
arr.push('NoCode');
|
|
@@ -50,17 +50,17 @@ test('min test 4', () => {
|
|
|
50
50
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
51
51
|
new Map([[Min.PARAMETER_ARRAY_SOURCE.getParameterName(), arr]]),
|
|
52
52
|
);
|
|
53
|
-
expect(min.execute(fep).allResults()[0].getResult().get('output')).toBe('NoCode');
|
|
53
|
+
expect((await min.execute(fep)).allResults()[0].getResult().get('output')).toBe('NoCode');
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
test('min test 5', () => {
|
|
56
|
+
test('min test 5', async () => {
|
|
57
57
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
58
58
|
new Map([[Min.PARAMETER_ARRAY_SOURCE.getParameterName(), null]]),
|
|
59
59
|
);
|
|
60
|
-
expect(
|
|
60
|
+
await expect(min.execute(fep)).rejects.toThrow();
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
test('min test 6', () => {
|
|
63
|
+
test('min test 6', async () => {
|
|
64
64
|
let arr: any[] = [];
|
|
65
65
|
|
|
66
66
|
arr.push(456);
|
|
@@ -74,10 +74,10 @@ test('min test 6', () => {
|
|
|
74
74
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
75
75
|
new Map([[Min.PARAMETER_ARRAY_SOURCE.getParameterName(), arr]]),
|
|
76
76
|
);
|
|
77
|
-
expect(min.execute(fep).allResults()[0].getResult().get('output')).toBe(1);
|
|
77
|
+
expect((await min.execute(fep)).allResults()[0].getResult().get('output')).toBe(1);
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
test('min test 7', () => {
|
|
80
|
+
test('min test 7', async () => {
|
|
81
81
|
let arr1: any[] = [];
|
|
82
82
|
arr1.push('c');
|
|
83
83
|
arr1.push('r');
|
|
@@ -87,13 +87,13 @@ test('min test 7', () => {
|
|
|
87
87
|
new Map([[Min.PARAMETER_ARRAY_SOURCE.getParameterName(), arr1]]),
|
|
88
88
|
);
|
|
89
89
|
|
|
90
|
-
expect(min.execute(fep).allResults()[0].getResult().get('output')).toBe('c');
|
|
90
|
+
expect((await min.execute(fep)).allResults()[0].getResult().get('output')).toBe('c');
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
test('min test 8', () => {
|
|
93
|
+
test('min test 8', async () => {
|
|
94
94
|
let arr: any[] = ['surendhar'];
|
|
95
95
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
96
96
|
new Map([[Min.PARAMETER_ARRAY_SOURCE.getParameterName(), arr]]),
|
|
97
97
|
);
|
|
98
|
-
expect(min.execute(fep).allResults()[0].getResult().get('output')).toBe('surendhar');
|
|
98
|
+
expect((await min.execute(fep)).allResults()[0].getResult().get('output')).toBe('surendhar');
|
|
99
99
|
});
|
|
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
|
|
|
3
3
|
|
|
4
4
|
let mismatch: MisMatch = new MisMatch();
|
|
5
5
|
|
|
6
|
-
test('mismatch test 1', () => {
|
|
6
|
+
test('mismatch test 1', async () => {
|
|
7
7
|
let arr: any[] = [];
|
|
8
8
|
arr.push('a');
|
|
9
9
|
arr.push('b');
|
|
@@ -33,15 +33,14 @@ test('mismatch test 1', () => {
|
|
|
33
33
|
);
|
|
34
34
|
|
|
35
35
|
expect(
|
|
36
|
-
mismatch
|
|
37
|
-
.execute(fep)
|
|
36
|
+
(await mismatch.execute(fep))
|
|
38
37
|
.allResults()[0]
|
|
39
38
|
.getResult()
|
|
40
39
|
.get(MisMatch.EVENT_RESULT_INTEGER.getName()),
|
|
41
40
|
).toBe(2);
|
|
42
41
|
});
|
|
43
42
|
|
|
44
|
-
test('mismatch test 2', () => {
|
|
43
|
+
test('mismatch test 2', async () => {
|
|
45
44
|
let arr: any[] = [];
|
|
46
45
|
arr.push('a');
|
|
47
46
|
arr.push('b');
|
|
@@ -70,10 +69,10 @@ test('mismatch test 2', () => {
|
|
|
70
69
|
]),
|
|
71
70
|
);
|
|
72
71
|
|
|
73
|
-
expect(
|
|
72
|
+
await expect(mismatch.execute(fep)).rejects.toThrow();
|
|
74
73
|
});
|
|
75
74
|
|
|
76
|
-
test('Mismatch test 3', () => {
|
|
75
|
+
test('Mismatch test 3', async () => {
|
|
77
76
|
let array1: any[] = [];
|
|
78
77
|
array1.push('test');
|
|
79
78
|
array1.push('Driven');
|
|
@@ -168,15 +167,14 @@ test('Mismatch test 3', () => {
|
|
|
168
167
|
);
|
|
169
168
|
|
|
170
169
|
expect(
|
|
171
|
-
mismatch
|
|
172
|
-
.execute(fep)
|
|
170
|
+
(await mismatch.execute(fep))
|
|
173
171
|
.allResults()[0]
|
|
174
172
|
.getResult()
|
|
175
173
|
.get(MisMatch.EVENT_RESULT_INTEGER.getName()),
|
|
176
174
|
).toBe(2);
|
|
177
175
|
});
|
|
178
176
|
|
|
179
|
-
test('mismatch test 4', () => {
|
|
177
|
+
test('mismatch test 4', async () => {
|
|
180
178
|
let arr: any[] = [];
|
|
181
179
|
arr.push('a');
|
|
182
180
|
arr.push('b');
|
|
@@ -206,8 +204,7 @@ test('mismatch test 4', () => {
|
|
|
206
204
|
);
|
|
207
205
|
|
|
208
206
|
expect(
|
|
209
|
-
mismatch
|
|
210
|
-
.execute(fep)
|
|
207
|
+
(await mismatch.execute(fep))
|
|
211
208
|
.allResults()[0]
|
|
212
209
|
.getResult()
|
|
213
210
|
.get(MisMatch.EVENT_RESULT_INTEGER.getName()),
|
|
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
|
|
|
3
3
|
|
|
4
4
|
let rev: Reverse = new Reverse();
|
|
5
5
|
|
|
6
|
-
test('Reverse test 1 ', () => {
|
|
6
|
+
test('Reverse test 1 ', async () => {
|
|
7
7
|
let src: any[] = [4, 5, 6, 7];
|
|
8
8
|
|
|
9
9
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters()
|
|
@@ -18,11 +18,11 @@ test('Reverse test 1 ', () => {
|
|
|
18
18
|
.setSteps(new Map([]));
|
|
19
19
|
|
|
20
20
|
let res = [5, 4, 6, 7];
|
|
21
|
-
rev.execute(fep);
|
|
21
|
+
await rev.execute(fep);
|
|
22
22
|
expect(src).toStrictEqual(res);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
test('Reverse test 2 ', () => {
|
|
25
|
+
test('Reverse test 2 ', async () => {
|
|
26
26
|
let src: any[] = [];
|
|
27
27
|
|
|
28
28
|
src.push('I');
|
|
@@ -48,10 +48,10 @@ test('Reverse test 2 ', () => {
|
|
|
48
48
|
.setContext(new Map([]))
|
|
49
49
|
.setSteps(new Map([]));
|
|
50
50
|
|
|
51
|
-
expect(
|
|
51
|
+
await expect(rev.execute(fep)).rejects.toThrow();
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
test('Reverse test 3', () => {
|
|
54
|
+
test('Reverse test 3', async () => {
|
|
55
55
|
let arr: any[] = [];
|
|
56
56
|
arr.push('a');
|
|
57
57
|
arr.push('b');
|
|
@@ -73,10 +73,10 @@ test('Reverse test 3', () => {
|
|
|
73
73
|
[Reverse.PARAMETER_INT_LENGTH.getParameterName(), arr.length],
|
|
74
74
|
]),
|
|
75
75
|
);
|
|
76
|
-
expect(
|
|
76
|
+
await expect(rev.execute(fep)).rejects.toThrow();
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
test('Rev test 4', () => {
|
|
79
|
+
test('Rev test 4', async () => {
|
|
80
80
|
let array1: any[] = [];
|
|
81
81
|
array1.push('test');
|
|
82
82
|
array1.push('Driven');
|
|
@@ -164,7 +164,7 @@ test('Rev test 4', () => {
|
|
|
164
164
|
res.push(array3);
|
|
165
165
|
res.push(array1);
|
|
166
166
|
|
|
167
|
-
rev.execute(fep);
|
|
167
|
+
await rev.execute(fep);
|
|
168
168
|
|
|
169
169
|
expect(arr).toStrictEqual(res);
|
|
170
170
|
|
|
@@ -183,11 +183,11 @@ test('Rev test 4', () => {
|
|
|
183
183
|
res1.push(array2);
|
|
184
184
|
res1.push(array4);
|
|
185
185
|
|
|
186
|
-
rev.execute(fep);
|
|
186
|
+
await rev.execute(fep);
|
|
187
187
|
expect(arr).toStrictEqual(res1);
|
|
188
188
|
});
|
|
189
189
|
|
|
190
|
-
test('rev test 5', () => {
|
|
190
|
+
test('rev test 5', async () => {
|
|
191
191
|
let arr: any[] = [];
|
|
192
192
|
arr.push('a');
|
|
193
193
|
arr.push('b');
|
|
@@ -220,7 +220,7 @@ test('rev test 5', () => {
|
|
|
220
220
|
res.push('c');
|
|
221
221
|
res.push('a');
|
|
222
222
|
|
|
223
|
-
rev.execute(fep);
|
|
223
|
+
await rev.execute(fep);
|
|
224
224
|
expect(arr).toStrictEqual(res);
|
|
225
225
|
|
|
226
226
|
fep.setArguments(
|
|
@@ -231,5 +231,5 @@ test('rev test 5', () => {
|
|
|
231
231
|
]),
|
|
232
232
|
);
|
|
233
233
|
|
|
234
|
-
expect(
|
|
234
|
+
await expect(rev.execute(fep)).rejects.toThrow();
|
|
235
235
|
});
|
|
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
|
|
|
3
3
|
|
|
4
4
|
let rotate: Rotate = new Rotate();
|
|
5
5
|
|
|
6
|
-
test('Rotate test1 ', () => {
|
|
6
|
+
test('Rotate test1 ', async () => {
|
|
7
7
|
let array: any[] = [];
|
|
8
8
|
array.push('I');
|
|
9
9
|
array.push('am');
|
|
@@ -43,12 +43,12 @@ test('Rotate test1 ', () => {
|
|
|
43
43
|
res.push('using');
|
|
44
44
|
res.push('eclipse');
|
|
45
45
|
|
|
46
|
-
rotate.execute(fep);
|
|
46
|
+
await rotate.execute(fep);
|
|
47
47
|
|
|
48
48
|
expect(array).toStrictEqual(res);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
test('rotate test 2', () => {
|
|
51
|
+
test('rotate test 2', async () => {
|
|
52
52
|
let src: any[] = [];
|
|
53
53
|
|
|
54
54
|
src.push('I');
|
|
@@ -89,12 +89,12 @@ test('rotate test 2', () => {
|
|
|
89
89
|
res.push('test');
|
|
90
90
|
res.push('Driven');
|
|
91
91
|
|
|
92
|
-
rotate.execute(fep);
|
|
92
|
+
await rotate.execute(fep);
|
|
93
93
|
|
|
94
94
|
expect(src).toStrictEqual(res);
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
test('rotate test 3', () => {
|
|
97
|
+
test('rotate test 3', async () => {
|
|
98
98
|
let array: any[] = [];
|
|
99
99
|
array.push('I');
|
|
100
100
|
array.push('am');
|
|
@@ -131,7 +131,7 @@ test('rotate test 3', () => {
|
|
|
131
131
|
|
|
132
132
|
res.push('I');
|
|
133
133
|
|
|
134
|
-
rotate.execute(fep);
|
|
134
|
+
await rotate.execute(fep);
|
|
135
135
|
|
|
136
136
|
expect(array).toStrictEqual(res);
|
|
137
137
|
});
|
|
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
|
|
|
3
3
|
|
|
4
4
|
let shuffle: Shuffle = new Shuffle();
|
|
5
5
|
|
|
6
|
-
test('shuffle test 1', () => {
|
|
6
|
+
test('shuffle test 1', async () => {
|
|
7
7
|
let array: any[] = [];
|
|
8
8
|
array.push('I');
|
|
9
9
|
array.push('am');
|
|
@@ -45,14 +45,17 @@ test('shuffle test 1', () => {
|
|
|
45
45
|
|
|
46
46
|
let set2: Set<any> = new Set<any>();
|
|
47
47
|
|
|
48
|
-
shuffle.execute(fep)
|
|
48
|
+
(await shuffle.execute(fep))
|
|
49
|
+
.allResults()[0]
|
|
50
|
+
.getResult()
|
|
51
|
+
.get(Shuffle.EVENT_RESULT_EMPTY.getName());
|
|
49
52
|
|
|
50
53
|
array.forEach((element) => set2.add(element));
|
|
51
54
|
|
|
52
55
|
expect(set2).toStrictEqual(set1);
|
|
53
56
|
});
|
|
54
57
|
|
|
55
|
-
test('Shuffle test 2', () => {
|
|
58
|
+
test('Shuffle test 2', async () => {
|
|
56
59
|
let array1: any[] = [];
|
|
57
60
|
array1.push('test');
|
|
58
61
|
array1.push('Driven');
|
|
@@ -144,7 +147,7 @@ test('Shuffle test 2', () => {
|
|
|
144
147
|
.setSteps(new Map([]))
|
|
145
148
|
.setContext(new Map([]));
|
|
146
149
|
|
|
147
|
-
shuffle.execute(fep);
|
|
150
|
+
await shuffle.execute(fep);
|
|
148
151
|
|
|
149
152
|
let Set2: Set<object> = new Set<Object>();
|
|
150
153
|
|