@fincity/kirun-js 1.0.4 → 1.1.1
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 +59 -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/util/LinkedListTest.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/module.js +2 -0
- package/dist/module.js.map +1 -0
- package/dist/types.d.ts +258 -109
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -5
- 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/runtime/KIRuntime.ts +26 -24
- package/src/index.ts +71 -19
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Delete } from '../../../../../src/engine/function/system/array/Delete';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
3
|
|
|
4
|
-
test('Delete Test 1', () => {
|
|
4
|
+
test('Delete Test 1', async () => {
|
|
5
5
|
let delet: Delete = new Delete();
|
|
6
|
-
|
|
7
6
|
let source: any[] = [12, 14, 15, 9];
|
|
8
7
|
|
|
9
8
|
let secondSource: any[] = [14, 15];
|
|
@@ -13,21 +12,20 @@ test('Delete Test 1', () => {
|
|
|
13
12
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters()
|
|
14
13
|
.setArguments(
|
|
15
14
|
new Map([
|
|
16
|
-
[Delete.
|
|
17
|
-
[Delete.
|
|
15
|
+
[Delete.PARAMETER_ARRAY_SOURCE.getParameterName(), source],
|
|
16
|
+
[Delete.PARAMETER_ANY_VAR_ARGS.getParameterName(), secondSource],
|
|
18
17
|
]),
|
|
19
18
|
)
|
|
20
19
|
.setSteps(new Map([]))
|
|
21
20
|
.setContext(new Map([]));
|
|
22
21
|
|
|
23
|
-
delet.execute(fep);
|
|
22
|
+
await delet.execute(fep);
|
|
24
23
|
|
|
25
24
|
expect(source).toStrictEqual(temp);
|
|
26
25
|
});
|
|
27
26
|
|
|
28
|
-
test('Delete Test 2', () => {
|
|
27
|
+
test('Delete Test 2', async () => {
|
|
29
28
|
let delet: Delete = new Delete();
|
|
30
|
-
|
|
31
29
|
let source: any[] = ['nocode', 'platform', 14];
|
|
32
30
|
|
|
33
31
|
let secondSource: any[] = ['platform'];
|
|
@@ -37,21 +35,21 @@ test('Delete Test 2', () => {
|
|
|
37
35
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters()
|
|
38
36
|
.setArguments(
|
|
39
37
|
new Map([
|
|
40
|
-
[Delete.
|
|
41
|
-
[Delete.
|
|
38
|
+
[Delete.PARAMETER_ARRAY_SOURCE.getParameterName(), source],
|
|
39
|
+
[Delete.PARAMETER_ANY_VAR_ARGS.getParameterName(), secondSource],
|
|
42
40
|
]),
|
|
43
41
|
)
|
|
44
42
|
.setSteps(new Map([]))
|
|
45
43
|
.setContext(new Map([]));
|
|
46
44
|
|
|
47
|
-
delet.execute(fep);
|
|
45
|
+
await delet.execute(fep);
|
|
48
46
|
|
|
49
47
|
expect(source).toStrictEqual(temp);
|
|
50
48
|
});
|
|
51
49
|
|
|
52
|
-
test('Delete Test 3', () => {
|
|
53
|
-
let delet: Delete = new Delete();
|
|
54
50
|
|
|
51
|
+
test('Delete Test 3', async () => {
|
|
52
|
+
let delet: Delete = new Delete();
|
|
55
53
|
let source = undefined;
|
|
56
54
|
|
|
57
55
|
let secondSource: any[] = ['platform'];
|
|
@@ -59,19 +57,18 @@ test('Delete Test 3', () => {
|
|
|
59
57
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters()
|
|
60
58
|
.setArguments(
|
|
61
59
|
new Map([
|
|
62
|
-
[Delete.
|
|
63
|
-
[Delete.
|
|
60
|
+
[Delete.PARAMETER_ARRAY_SOURCE.getParameterName(), source],
|
|
61
|
+
[Delete.PARAMETER_ANY_VAR_ARGS.getParameterName(), secondSource],
|
|
64
62
|
]),
|
|
65
63
|
)
|
|
66
64
|
.setSteps(new Map([]))
|
|
67
65
|
.setContext(new Map([]));
|
|
68
66
|
|
|
69
|
-
expect(
|
|
67
|
+
await expect(delet.execute(fep)).rejects.toThrow();
|
|
70
68
|
});
|
|
71
69
|
|
|
72
|
-
test('Delete Test 3', () => {
|
|
70
|
+
test('Delete Test 3', async () => {
|
|
73
71
|
let delet: Delete = new Delete();
|
|
74
|
-
|
|
75
72
|
let source: any[] = ['platform'];
|
|
76
73
|
|
|
77
74
|
let secondSource = undefined;
|
|
@@ -79,19 +76,18 @@ test('Delete Test 3', () => {
|
|
|
79
76
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters()
|
|
80
77
|
.setArguments(
|
|
81
78
|
new Map([
|
|
82
|
-
[Delete.
|
|
83
|
-
[Delete.
|
|
79
|
+
[Delete.PARAMETER_ARRAY_SOURCE.getParameterName(), source],
|
|
80
|
+
[Delete.PARAMETER_ANY_VAR_ARGS.getParameterName(), secondSource],
|
|
84
81
|
]),
|
|
85
82
|
)
|
|
86
83
|
.setSteps(new Map([]))
|
|
87
84
|
.setContext(new Map([]));
|
|
88
85
|
|
|
89
|
-
expect(
|
|
86
|
+
await expect(delet.execute(fep)).rejects.toThrow();
|
|
90
87
|
});
|
|
91
88
|
|
|
92
|
-
test('Delete Test 4', () => {
|
|
89
|
+
test('Delete Test 4', async () => {
|
|
93
90
|
let delet: Delete = new Delete();
|
|
94
|
-
|
|
95
91
|
let source: any[] = ['platform'];
|
|
96
92
|
|
|
97
93
|
let secondSource: any[] = [];
|
|
@@ -99,12 +95,50 @@ test('Delete Test 4', () => {
|
|
|
99
95
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters()
|
|
100
96
|
.setArguments(
|
|
101
97
|
new Map([
|
|
102
|
-
[Delete.
|
|
103
|
-
[Delete.
|
|
98
|
+
[Delete.PARAMETER_ARRAY_SOURCE.getParameterName(), source],
|
|
99
|
+
[Delete.PARAMETER_ANY_VAR_ARGS.getParameterName(), secondSource],
|
|
104
100
|
]),
|
|
105
101
|
)
|
|
106
102
|
.setSteps(new Map([]))
|
|
107
103
|
.setContext(new Map([]));
|
|
108
104
|
|
|
109
|
-
expect(
|
|
105
|
+
await expect(delet.execute(fep)).rejects.toThrow();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('Delete Test 5', () => {
|
|
109
|
+
var arr1: any[] = ['nocode', 'platform', 14];
|
|
110
|
+
var arr2: any[] = ['nocode', 'platiform', 14];
|
|
111
|
+
var obj: object = {
|
|
112
|
+
arr: arr1,
|
|
113
|
+
sri: 'krishna',
|
|
114
|
+
name: 'surendhar',
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
var arr: any[] = [];
|
|
118
|
+
arr.push(arr1);
|
|
119
|
+
arr.push(arr2);
|
|
120
|
+
arr.push(obj);
|
|
121
|
+
arr.push(arr2);
|
|
122
|
+
arr.push(obj);
|
|
123
|
+
|
|
124
|
+
var delArr: any[] = [];
|
|
125
|
+
delArr.push(obj);
|
|
126
|
+
delArr.push('2');
|
|
127
|
+
delArr.push([]);
|
|
128
|
+
|
|
129
|
+
var res: any[] = [arr1, arr2, arr2];
|
|
130
|
+
|
|
131
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters()
|
|
132
|
+
.setArguments(
|
|
133
|
+
new Map([
|
|
134
|
+
[Delete.PARAMETER_ARRAY_SOURCE.getParameterName(), arr],
|
|
135
|
+
[Delete.PARAMETER_ANY_VAR_ARGS.getParameterName(), delArr],
|
|
136
|
+
]),
|
|
137
|
+
)
|
|
138
|
+
.setSteps(new Map([]))
|
|
139
|
+
.setContext(new Map([]));
|
|
140
|
+
|
|
141
|
+
delet.execute(fep);
|
|
142
|
+
|
|
143
|
+
expect(arr).toStrictEqual(res);
|
|
110
144
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Disjoint } from '../../../../../src/engine/function/system/array/Disjoint';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
3
|
|
|
4
|
-
test('Disjoint Test 1', () => {
|
|
4
|
+
test('Disjoint Test 1', async () => {
|
|
5
5
|
let dis: Disjoint = new Disjoint();
|
|
6
6
|
|
|
7
7
|
let arr: any[] = [];
|
|
@@ -42,8 +42,7 @@ test('Disjoint Test 1', () => {
|
|
|
42
42
|
set1.add('p');
|
|
43
43
|
|
|
44
44
|
let set2: Set<any> = new Set<any>();
|
|
45
|
-
let res: any[] = dis
|
|
46
|
-
.execute(fep)
|
|
45
|
+
let res: any[] = (await dis.execute(fep))
|
|
47
46
|
.allResults()[0]
|
|
48
47
|
.getResult()
|
|
49
48
|
.get(Disjoint.EVENT_RESULT_ARRAY.getName());
|
|
@@ -53,7 +52,7 @@ test('Disjoint Test 1', () => {
|
|
|
53
52
|
expect(set1).toStrictEqual(set2);
|
|
54
53
|
});
|
|
55
54
|
|
|
56
|
-
test('Disjoint Test 2', () => {
|
|
55
|
+
test('Disjoint Test 2', async () => {
|
|
57
56
|
let dis: Disjoint = new Disjoint();
|
|
58
57
|
|
|
59
58
|
let arr: any[] = [];
|
|
@@ -85,10 +84,10 @@ test('Disjoint Test 2', () => {
|
|
|
85
84
|
]),
|
|
86
85
|
);
|
|
87
86
|
|
|
88
|
-
expect(
|
|
87
|
+
await expect(dis.execute(fep)).rejects.toThrow;
|
|
89
88
|
});
|
|
90
89
|
|
|
91
|
-
test('Disjoint test 3', () => {
|
|
90
|
+
test('Disjoint test 3', async () => {
|
|
92
91
|
let dis: Disjoint = new Disjoint();
|
|
93
92
|
|
|
94
93
|
let array1: any[] = [];
|
|
@@ -174,7 +173,7 @@ test('Disjoint test 3', () => {
|
|
|
174
173
|
]),
|
|
175
174
|
);
|
|
176
175
|
|
|
177
|
-
var res: any[] = dis.execute(fep).allResults()[0].getResult().get('output');
|
|
176
|
+
var res: any[] = (await dis.execute(fep)).allResults()[0].getResult().get('output');
|
|
178
177
|
|
|
179
178
|
let set2: Set<Object> = new Set<Object>();
|
|
180
179
|
|
|
@@ -3,7 +3,7 @@ import { FunctionOutput } from '../../../../../src/engine/model/FunctionOutput';
|
|
|
3
3
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
4
4
|
import { MapUtil } from '../../../../../src/engine/util/MapUtil';
|
|
5
5
|
|
|
6
|
-
test('Equals Test', () => {
|
|
6
|
+
test('Equals Test', async () => {
|
|
7
7
|
let equals: Equals = new Equals();
|
|
8
8
|
|
|
9
9
|
let srcArray: any[] = [30, 31, 32, 33, 34];
|
|
@@ -19,13 +19,13 @@ test('Equals Test', () => {
|
|
|
19
19
|
),
|
|
20
20
|
);
|
|
21
21
|
|
|
22
|
-
let fo: FunctionOutput = equals.execute(fep);
|
|
22
|
+
let fo: FunctionOutput = await equals.execute(fep);
|
|
23
23
|
|
|
24
24
|
expect(fo.allResults()[0].getResult().get(Equals.EVENT_RESULT_NAME)).toBeTruthy();
|
|
25
25
|
|
|
26
26
|
findArray[1] = 41;
|
|
27
27
|
|
|
28
|
-
fo = equals.execute(fep);
|
|
28
|
+
fo = await equals.execute(fep);
|
|
29
29
|
|
|
30
30
|
expect(fo.allResults()[0].getResult().get(Equals.EVENT_RESULT_NAME)).toBeFalsy;
|
|
31
31
|
|
|
@@ -43,7 +43,7 @@ test('Equals Test', () => {
|
|
|
43
43
|
),
|
|
44
44
|
);
|
|
45
45
|
|
|
46
|
-
fo = equals.execute(fep);
|
|
46
|
+
fo = await equals.execute(fep);
|
|
47
47
|
|
|
48
48
|
expect(fo.allResults()[0].getResult().get(Equals.EVENT_RESULT_NAME)).toBeTruthy();
|
|
49
49
|
|
|
@@ -61,7 +61,7 @@ test('Equals Test', () => {
|
|
|
61
61
|
),
|
|
62
62
|
);
|
|
63
63
|
|
|
64
|
-
fo = equals.execute(fep);
|
|
64
|
+
fo = await equals.execute(fep);
|
|
65
65
|
|
|
66
66
|
expect(fo.allResults()[0].getResult().get(Equals.EVENT_RESULT_NAME)).toBeTruthy();
|
|
67
67
|
});
|
|
@@ -2,7 +2,7 @@ import { Fill } from '../../../../../src/engine/function/system/array/Fill';
|
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
3
|
import { MapUtil } from '../../../../../src/engine/util/MapUtil';
|
|
4
4
|
|
|
5
|
-
test('Fill Test', () => {
|
|
5
|
+
test('Fill Test', async () => {
|
|
6
6
|
let fill: Fill = new Fill();
|
|
7
7
|
|
|
8
8
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters();
|
|
@@ -10,7 +10,7 @@ test('Fill Test', () => {
|
|
|
10
10
|
|
|
11
11
|
fep.setArguments(MapUtil.of('source', array as any, 'element', 3));
|
|
12
12
|
|
|
13
|
-
fill.execute(fep);
|
|
13
|
+
await fill.execute(fep);
|
|
14
14
|
expect(array).toStrictEqual([3, 3]);
|
|
15
15
|
|
|
16
16
|
fep.setArguments(MapUtil.of('source', array as any, 'element', 5, 'srcFrom', 2, 'length', 5))
|
|
@@ -18,7 +18,7 @@ test('Fill Test', () => {
|
|
|
18
18
|
.setSteps(MapUtil.of());
|
|
19
19
|
|
|
20
20
|
let finArray = [3, 3, 5, 5, 5, 5, 5];
|
|
21
|
-
fill.execute(fep);
|
|
21
|
+
await fill.execute(fep);
|
|
22
22
|
|
|
23
23
|
expect(array).toStrictEqual(finArray);
|
|
24
24
|
|
|
@@ -26,11 +26,11 @@ test('Fill Test', () => {
|
|
|
26
26
|
|
|
27
27
|
finArray = [3, 3, 5, 5, 5, 25, 25];
|
|
28
28
|
|
|
29
|
-
fill.execute(fep);
|
|
29
|
+
await fill.execute(fep);
|
|
30
30
|
|
|
31
31
|
expect(array).toStrictEqual(finArray);
|
|
32
32
|
|
|
33
33
|
fep.setArguments(MapUtil.of('source', array as any, 'element', 20, 'srcFrom', -1));
|
|
34
34
|
|
|
35
|
-
expect(
|
|
35
|
+
await expect(fill.execute(fep)).rejects.toThrow();
|
|
36
36
|
});
|
|
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
|
|
|
3
3
|
|
|
4
4
|
let freq: Frequency = new Frequency();
|
|
5
5
|
|
|
6
|
-
test('freq test 1', () => {
|
|
6
|
+
test('freq test 1', async () => {
|
|
7
7
|
let array: any[] = [];
|
|
8
8
|
array.push('test');
|
|
9
9
|
array.push('Driven');
|
|
@@ -31,12 +31,12 @@ test('freq test 1', () => {
|
|
|
31
31
|
]),
|
|
32
32
|
);
|
|
33
33
|
|
|
34
|
-
expect(
|
|
35
|
-
|
|
36
|
-
);
|
|
34
|
+
expect(
|
|
35
|
+
(await freq.execute(fep)).allResults()[0].getResult().get(Frequency.EVENT_INDEX.getName()),
|
|
36
|
+
).toBe(2);
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
test('freq test 2', () => {
|
|
39
|
+
test('freq test 2', async () => {
|
|
40
40
|
let array: any[] = [];
|
|
41
41
|
array.push('test');
|
|
42
42
|
array.push('Driven');
|
|
@@ -66,7 +66,7 @@ test('freq test 2', () => {
|
|
|
66
66
|
]),
|
|
67
67
|
);
|
|
68
68
|
|
|
69
|
-
expect(
|
|
69
|
+
await expect(freq.execute(fep)).rejects.toThrow();
|
|
70
70
|
|
|
71
71
|
fep.setArguments(
|
|
72
72
|
new Map<string, any>([
|
|
@@ -77,10 +77,10 @@ test('freq test 2', () => {
|
|
|
77
77
|
]),
|
|
78
78
|
);
|
|
79
79
|
|
|
80
|
-
expect(
|
|
80
|
+
await expect(freq.execute(fep)).rejects.toThrow();
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
test('freq test 3', () => {
|
|
83
|
+
test('freq test 3', async () => {
|
|
84
84
|
let array: any[] = [];
|
|
85
85
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters().setArguments(
|
|
86
86
|
new Map<string, any>([
|
|
@@ -91,7 +91,7 @@ test('freq test 3', () => {
|
|
|
91
91
|
]),
|
|
92
92
|
);
|
|
93
93
|
|
|
94
|
-
expect(
|
|
95
|
-
0,
|
|
96
|
-
);
|
|
94
|
+
expect(
|
|
95
|
+
(await freq.execute(fep)).allResults()[0].getResult().get(Frequency.EVENT_INDEX.getName()),
|
|
96
|
+
).toBe(0);
|
|
97
97
|
});
|
|
@@ -3,7 +3,7 @@ import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/F
|
|
|
3
3
|
|
|
4
4
|
let ioa: IndexOfArray = new IndexOfArray();
|
|
5
5
|
|
|
6
|
-
test('index of array 1', () => {
|
|
6
|
+
test('index of array 1', async () => {
|
|
7
7
|
let arr: any[] = [];
|
|
8
8
|
arr.push('a');
|
|
9
9
|
arr.push('b');
|
|
@@ -29,15 +29,14 @@ test('index of array 1', () => {
|
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
expect(
|
|
32
|
-
ioa
|
|
33
|
-
.execute(fep)
|
|
32
|
+
(await ioa.execute(fep))
|
|
34
33
|
.allResults()[0]
|
|
35
34
|
.getResult()
|
|
36
35
|
.get(IndexOfArray.EVENT_RESULT_INTEGER.getName()),
|
|
37
36
|
).toBe(1);
|
|
38
37
|
});
|
|
39
38
|
|
|
40
|
-
test('Index of array 2', () => {
|
|
39
|
+
test('Index of array 2', async () => {
|
|
41
40
|
let arr: any[] = [];
|
|
42
41
|
arr.push('a');
|
|
43
42
|
arr.push('b');
|
|
@@ -64,15 +63,14 @@ test('Index of array 2', () => {
|
|
|
64
63
|
);
|
|
65
64
|
|
|
66
65
|
expect(
|
|
67
|
-
ioa
|
|
68
|
-
.execute(fep)
|
|
66
|
+
(await ioa.execute(fep))
|
|
69
67
|
.allResults()[0]
|
|
70
68
|
.getResult()
|
|
71
69
|
.get(IndexOfArray.EVENT_RESULT_INTEGER.getName()),
|
|
72
70
|
).toBe(5);
|
|
73
71
|
});
|
|
74
72
|
|
|
75
|
-
test('index of array 3', () => {
|
|
73
|
+
test('index of array 3', async () => {
|
|
76
74
|
let array1: any[] = [];
|
|
77
75
|
array1.push('test');
|
|
78
76
|
array1.push('Driven');
|
|
@@ -161,15 +159,14 @@ test('index of array 3', () => {
|
|
|
161
159
|
);
|
|
162
160
|
|
|
163
161
|
expect(
|
|
164
|
-
ioa
|
|
165
|
-
.execute(fep)
|
|
162
|
+
(await ioa.execute(fep))
|
|
166
163
|
.allResults()[0]
|
|
167
164
|
.getResult()
|
|
168
165
|
.get(IndexOfArray.EVENT_RESULT_INTEGER.getName()),
|
|
169
166
|
).toBe(7);
|
|
170
167
|
});
|
|
171
168
|
|
|
172
|
-
test('index of array test 4', () => {
|
|
169
|
+
test('index of array test 4', async () => {
|
|
173
170
|
let arr: any[] = [];
|
|
174
171
|
arr.push('a');
|
|
175
172
|
arr.push('b');
|
|
@@ -195,15 +192,14 @@ test('index of array test 4', () => {
|
|
|
195
192
|
);
|
|
196
193
|
|
|
197
194
|
expect(
|
|
198
|
-
ioa
|
|
199
|
-
.execute(fep)
|
|
195
|
+
(await ioa.execute(fep))
|
|
200
196
|
.allResults()[0]
|
|
201
197
|
.getResult()
|
|
202
198
|
.get(IndexOfArray.EVENT_RESULT_INTEGER.getName()),
|
|
203
199
|
).toBe(-1);
|
|
204
200
|
});
|
|
205
201
|
|
|
206
|
-
test('index of array 5', () => {
|
|
202
|
+
test('index of array 5', async () => {
|
|
207
203
|
let arr: any[] = [];
|
|
208
204
|
arr.push('a');
|
|
209
205
|
arr.push('b');
|
|
@@ -226,15 +222,14 @@ test('index of array 5', () => {
|
|
|
226
222
|
]),
|
|
227
223
|
);
|
|
228
224
|
expect(
|
|
229
|
-
ioa
|
|
230
|
-
.execute(fep)
|
|
225
|
+
(await ioa.execute(fep))
|
|
231
226
|
.allResults()[0]
|
|
232
227
|
.getResult()
|
|
233
228
|
.get(IndexOfArray.EVENT_RESULT_INTEGER.getName()),
|
|
234
229
|
).toBe(6);
|
|
235
230
|
});
|
|
236
231
|
|
|
237
|
-
test('index of array 6', () => {
|
|
232
|
+
test('index of array 6', async () => {
|
|
238
233
|
let arr: any[] = [];
|
|
239
234
|
arr.push('a');
|
|
240
235
|
arr.push('b');
|
|
@@ -246,10 +241,10 @@ test('index of array 6', () => {
|
|
|
246
241
|
[IndexOfArray.PARAMETER_ARRAY_SECOND_SOURCE.getParameterName(), undefined],
|
|
247
242
|
]),
|
|
248
243
|
);
|
|
249
|
-
expect(
|
|
244
|
+
await expect(ioa.execute(fep)).rejects.toThrow();
|
|
250
245
|
});
|
|
251
246
|
|
|
252
|
-
test('index of array 3', () => {
|
|
247
|
+
test('index of array 3', async () => {
|
|
253
248
|
let array1: any[] = [];
|
|
254
249
|
array1.push('test');
|
|
255
250
|
array1.push('Driven');
|
|
@@ -338,8 +333,7 @@ test('index of array 3', () => {
|
|
|
338
333
|
);
|
|
339
334
|
|
|
340
335
|
expect(
|
|
341
|
-
ioa
|
|
342
|
-
.execute(fep)
|
|
336
|
+
(await ioa.execute(fep))
|
|
343
337
|
.allResults()[0]
|
|
344
338
|
.getResult()
|
|
345
339
|
.get(IndexOfArray.EVENT_RESULT_INTEGER.getName()),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IndexOf } from '../../../../../src/engine/function/system/array/IndexOf';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
3
|
|
|
4
|
-
test('Index of Test 1', () => {
|
|
4
|
+
test('Index of Test 1', async () => {
|
|
5
5
|
let ind: IndexOf = new IndexOf();
|
|
6
6
|
|
|
7
7
|
let array: string[] = [];
|
|
@@ -33,11 +33,14 @@ test('Index of Test 1', () => {
|
|
|
33
33
|
]),
|
|
34
34
|
);
|
|
35
35
|
expect(
|
|
36
|
-
ind.execute(fep)
|
|
36
|
+
(await ind.execute(fep))
|
|
37
|
+
.allResults()[0]
|
|
38
|
+
.getResult()
|
|
39
|
+
.get(IndexOf.EVENT_RESULT_INTEGER.getName()),
|
|
37
40
|
).toBe(12);
|
|
38
41
|
});
|
|
39
42
|
|
|
40
|
-
test('Index of Test 2', () => {
|
|
43
|
+
test('Index of Test 2', async () => {
|
|
41
44
|
let ind: IndexOf = new IndexOf();
|
|
42
45
|
|
|
43
46
|
let array: string[] = [];
|
|
@@ -69,7 +72,7 @@ test('Index of Test 2', () => {
|
|
|
69
72
|
]),
|
|
70
73
|
);
|
|
71
74
|
|
|
72
|
-
expect(
|
|
75
|
+
await expect(ind.execute(fep)).rejects.toThrow();
|
|
73
76
|
|
|
74
77
|
fep.setArguments(
|
|
75
78
|
new Map<string, any>([
|
|
@@ -78,12 +81,12 @@ test('Index of Test 2', () => {
|
|
|
78
81
|
[IndexOf.PARAMETER_INT_FIND_FROM.getParameterName(), -2],
|
|
79
82
|
]),
|
|
80
83
|
);
|
|
81
|
-
expect(
|
|
82
|
-
|
|
83
|
-
);
|
|
84
|
+
expect(
|
|
85
|
+
(await ind.execute(fep)).allResults()[0].getResult().get(IndexOf.EVENT_INDEX.getName()),
|
|
86
|
+
).toBe(-1);
|
|
84
87
|
});
|
|
85
88
|
|
|
86
|
-
test('Index of Test 3', () => {
|
|
89
|
+
test('Index of Test 3', async () => {
|
|
87
90
|
let ind: IndexOf = new IndexOf();
|
|
88
91
|
|
|
89
92
|
let array: string[] = [];
|
|
@@ -116,11 +119,14 @@ test('Index of Test 3', () => {
|
|
|
116
119
|
);
|
|
117
120
|
|
|
118
121
|
expect(
|
|
119
|
-
ind.execute(fep)
|
|
122
|
+
(await ind.execute(fep))
|
|
123
|
+
.allResults()[0]
|
|
124
|
+
.getResult()
|
|
125
|
+
.get(IndexOf.EVENT_RESULT_INTEGER.getName()),
|
|
120
126
|
).toBe(-1);
|
|
121
127
|
});
|
|
122
128
|
|
|
123
|
-
test('Index of Test 4', () => {
|
|
129
|
+
test('Index of Test 4', async () => {
|
|
124
130
|
let ind: IndexOf = new IndexOf();
|
|
125
131
|
|
|
126
132
|
let array: string[] = [];
|
|
@@ -206,11 +212,14 @@ test('Index of Test 4', () => {
|
|
|
206
212
|
);
|
|
207
213
|
|
|
208
214
|
expect(
|
|
209
|
-
ind.execute(fep)
|
|
215
|
+
(await ind.execute(fep))
|
|
216
|
+
.allResults()[0]
|
|
217
|
+
.getResult()
|
|
218
|
+
.get(IndexOf.EVENT_RESULT_INTEGER.getName()),
|
|
210
219
|
).toBe(2);
|
|
211
220
|
});
|
|
212
221
|
|
|
213
|
-
test('indexof test 5', () => {
|
|
222
|
+
test('indexof test 5', async () => {
|
|
214
223
|
let ind: IndexOf = new IndexOf();
|
|
215
224
|
|
|
216
225
|
let array1: string[] = [];
|
|
@@ -254,7 +263,10 @@ test('indexof test 5', () => {
|
|
|
254
263
|
);
|
|
255
264
|
|
|
256
265
|
expect(
|
|
257
|
-
ind.execute(fep)
|
|
266
|
+
(await ind.execute(fep))
|
|
267
|
+
.allResults()[0]
|
|
268
|
+
.getResult()
|
|
269
|
+
.get(IndexOf.EVENT_RESULT_INTEGER.getName()),
|
|
258
270
|
).toBe(5);
|
|
259
271
|
|
|
260
272
|
fep.setArguments(
|
|
@@ -263,5 +275,5 @@ test('indexof test 5', () => {
|
|
|
263
275
|
[IndexOf.PARAMETER_ANY_NOT_NULL.getParameterName(), null],
|
|
264
276
|
]),
|
|
265
277
|
);
|
|
266
|
-
expect(
|
|
278
|
+
await expect(ind.execute(fep)).rejects.toThrow();
|
|
267
279
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Insert } from '../../../../../src/engine/function/system/array/Insert';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
3
|
|
|
4
|
-
test('Insert of Test 1', () => {
|
|
4
|
+
test('Insert of Test 1', async () => {
|
|
5
5
|
let ins: Insert = new Insert();
|
|
6
6
|
|
|
7
7
|
let array: any[] = [];
|
|
@@ -54,12 +54,12 @@ test('Insert of Test 1', () => {
|
|
|
54
54
|
res.push('Driven');
|
|
55
55
|
res.push('developement');
|
|
56
56
|
|
|
57
|
-
ins.execute(fep);
|
|
57
|
+
await ins.execute(fep);
|
|
58
58
|
|
|
59
59
|
expect(array).toStrictEqual(res);
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
test('Insert of Test 2', () => {
|
|
62
|
+
test('Insert of Test 2', async () => {
|
|
63
63
|
let ins: Insert = new Insert();
|
|
64
64
|
|
|
65
65
|
let arr: any[] = [];
|
|
@@ -95,12 +95,12 @@ test('Insert of Test 2', () => {
|
|
|
95
95
|
res.push(6);
|
|
96
96
|
res.push(7);
|
|
97
97
|
res.push(8);
|
|
98
|
-
ins.execute(fep);
|
|
98
|
+
await ins.execute(fep);
|
|
99
99
|
|
|
100
100
|
expect(arr).toStrictEqual(res);
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
test('Insert of Test 3', () => {
|
|
103
|
+
test('Insert of Test 3', async () => {
|
|
104
104
|
let ins: Insert = new Insert();
|
|
105
105
|
|
|
106
106
|
let arr: any[] = [];
|
|
@@ -136,12 +136,12 @@ test('Insert of Test 3', () => {
|
|
|
136
136
|
res.push(6);
|
|
137
137
|
res.push(7);
|
|
138
138
|
res.push(8);
|
|
139
|
-
ins.execute(fep);
|
|
139
|
+
await ins.execute(fep);
|
|
140
140
|
|
|
141
141
|
expect(arr).toStrictEqual(res);
|
|
142
142
|
});
|
|
143
143
|
|
|
144
|
-
test('Insert of Test 4', () => {
|
|
144
|
+
test('Insert of Test 4', async () => {
|
|
145
145
|
let ins: Insert = new Insert();
|
|
146
146
|
|
|
147
147
|
let arr: any[] = [];
|
|
@@ -178,12 +178,12 @@ test('Insert of Test 4', () => {
|
|
|
178
178
|
res.push(8);
|
|
179
179
|
res.push(['this is an array']);
|
|
180
180
|
|
|
181
|
-
ins.execute(fep);
|
|
181
|
+
await ins.execute(fep);
|
|
182
182
|
|
|
183
183
|
expect(arr).toStrictEqual(res);
|
|
184
184
|
});
|
|
185
185
|
|
|
186
|
-
test('Insert of Test 5', () => {
|
|
186
|
+
test('Insert of Test 5', async () => {
|
|
187
187
|
let ins: Insert = new Insert();
|
|
188
188
|
|
|
189
189
|
let arr: any[] = [];
|
|
@@ -202,12 +202,12 @@ test('Insert of Test 5', () => {
|
|
|
202
202
|
|
|
203
203
|
res.push(['this is an array']);
|
|
204
204
|
|
|
205
|
-
ins.execute(fep);
|
|
205
|
+
await ins.execute(fep);
|
|
206
206
|
|
|
207
207
|
expect(arr).toStrictEqual(res);
|
|
208
208
|
});
|
|
209
209
|
|
|
210
|
-
test('Insert of Test 6', () => {
|
|
210
|
+
test('Insert of Test 6', async () => {
|
|
211
211
|
let ins: Insert = new Insert();
|
|
212
212
|
|
|
213
213
|
let fep: FunctionExecutionParameters = new FunctionExecutionParameters()
|
|
@@ -225,5 +225,5 @@ test('Insert of Test 6', () => {
|
|
|
225
225
|
|
|
226
226
|
res.push(['this is an array']);
|
|
227
227
|
|
|
228
|
-
expect(
|
|
228
|
+
await expect(ins.execute(fep)).rejects.toThrow();
|
|
229
229
|
});
|