fable 3.1.30 → 3.1.32
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/dist/fable.js +8 -5
- package/dist/fable.js.map +1 -1
- package/dist/fable.min.js +1 -1
- package/dist/fable.min.js.map +1 -1
- package/package.json +1 -1
- package/source/services/Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-FunctionMap.json +4 -0
- package/source/services/Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Postfix.js +5 -0
- package/source/services/Fable-Service-ExpressionParser/RNI_Randy.json +1 -0
- package/source/services/Fable-Service-ExpressionParser/RNI_Tool.json +1 -0
- package/source/services/Fable-Service-Utility.js +52 -0
- package/test/ExpressionParser_tests.js +646 -638
- package/test/Utility_tests.js +48 -0
package/test/Utility_tests.js
CHANGED
|
@@ -70,6 +70,54 @@ suite
|
|
|
70
70
|
Expect(tmpInternalValueArray[3]).to.equal(undefined);
|
|
71
71
|
Expect(tmpInternalValueArray[4]).to.equal(6.75);
|
|
72
72
|
|
|
73
|
+
let tmpTestObject1 = {'a': 1, 'b': 2, 'c': 3};
|
|
74
|
+
let tmpTestObject2 = {'d': 4, 'e': 5, 'f': 6};
|
|
75
|
+
let tmpTestObject3 = {'g': 7, 'h': 8};
|
|
76
|
+
let tmpObjectCoordinateMap = testFable.services.Utility.generateArrayOfObjectsFromSets('x', tmpTestObject1, 'y', tmpTestObject2);
|
|
77
|
+
Expect(tmpObjectCoordinateMap).to.be.an('array');
|
|
78
|
+
Expect(tmpObjectCoordinateMap.length).to.equal(3);
|
|
79
|
+
Expect(tmpObjectCoordinateMap[0]).to.have.property('x').that.equals(1);
|
|
80
|
+
Expect(tmpObjectCoordinateMap[0]).to.have.property('y').that.equals(4);
|
|
81
|
+
Expect(tmpObjectCoordinateMap[1]).to.have.property('x').that.equals(2);
|
|
82
|
+
Expect(tmpObjectCoordinateMap[1]).to.have.property('y').that.equals(5);
|
|
83
|
+
Expect(tmpObjectCoordinateMap[2]).to.have.property('x').that.equals(3);
|
|
84
|
+
Expect(tmpObjectCoordinateMap[2]).to.have.property('y').that.equals(6);
|
|
85
|
+
|
|
86
|
+
let tmpObjectCoordinateMapBadSet = testFable.services.Utility.generateArrayOfObjectsFromSets('x', tmpTestObject1, 'y', tmpTestObject2, 'z', null);
|
|
87
|
+
Expect(tmpObjectCoordinateMap).to.be.an('array');
|
|
88
|
+
Expect(tmpObjectCoordinateMap.length).to.equal(3);
|
|
89
|
+
Expect(tmpObjectCoordinateMap[0]).to.have.property('x').that.equals(1);
|
|
90
|
+
Expect(tmpObjectCoordinateMap[0]).to.have.property('y').that.equals(4);
|
|
91
|
+
Expect(tmpObjectCoordinateMap[1]).to.have.property('x').that.equals(2);
|
|
92
|
+
Expect(tmpObjectCoordinateMap[1]).to.have.property('y').that.equals(5);
|
|
93
|
+
Expect(tmpObjectCoordinateMap[2]).to.have.property('x').that.equals(3);
|
|
94
|
+
Expect(tmpObjectCoordinateMap[2]).to.have.property('y').that.equals(6);
|
|
95
|
+
|
|
96
|
+
let tmpSparseCoordinateMap = testFable.services.Utility.generateArrayOfObjectsFromSets('x', tmpTestObject1, 'y', tmpTestObject3);
|
|
97
|
+
Expect(tmpSparseCoordinateMap).to.be.an('array');
|
|
98
|
+
Expect(tmpSparseCoordinateMap.length).to.equal(3);
|
|
99
|
+
Expect(tmpSparseCoordinateMap[0]).to.have.property('x').that.equals(1);
|
|
100
|
+
Expect(tmpSparseCoordinateMap[0]).to.have.property('y').that.equals(7);
|
|
101
|
+
Expect(tmpSparseCoordinateMap[1]).to.have.property('x').that.equals(2);
|
|
102
|
+
Expect(tmpSparseCoordinateMap[1]).to.have.property('y').that.equals(8);
|
|
103
|
+
Expect(tmpSparseCoordinateMap[2]).to.have.property('x').that.equals(3);
|
|
104
|
+
Expect(tmpSparseCoordinateMap[2]).to.not.have.property('y');
|
|
105
|
+
// The third value in tmpTestObject1 has no corresponding value in tmpTestObject3
|
|
106
|
+
|
|
107
|
+
let tmpObjectCoordinateMapBigSet = testFable.services.Utility.generateArrayOfObjectsFromSets('x', tmpTestObject1, 'y', tmpTestObject2, 'z', tmpTestObject3);
|
|
108
|
+
Expect(tmpObjectCoordinateMapBigSet).to.be.an('array');
|
|
109
|
+
Expect(tmpObjectCoordinateMapBigSet.length).to.equal(3);
|
|
110
|
+
Expect(tmpObjectCoordinateMapBigSet[0]).to.have.property('x').that.equals(1);
|
|
111
|
+
Expect(tmpObjectCoordinateMapBigSet[0]).to.have.property('y').that.equals(4);
|
|
112
|
+
Expect(tmpObjectCoordinateMapBigSet[0]).to.have.property('z').that.equals(7);
|
|
113
|
+
Expect(tmpObjectCoordinateMapBigSet[1]).to.have.property('x').that.equals(2);
|
|
114
|
+
Expect(tmpObjectCoordinateMapBigSet[1]).to.have.property('y').that.equals(5);
|
|
115
|
+
Expect(tmpObjectCoordinateMapBigSet[1]).to.have.property('z').that.equals(8);
|
|
116
|
+
Expect(tmpObjectCoordinateMapBigSet[2]).to.have.property('x').that.equals(3);
|
|
117
|
+
Expect(tmpObjectCoordinateMapBigSet[2]).to.have.property('y').that.equals(6);
|
|
118
|
+
Expect(tmpObjectCoordinateMapBigSet[2]).to.not.have.property('z');
|
|
119
|
+
// The third value in tmpTestObject1 and tmpTestObject2 has no corresponding value in tmpTestObject3
|
|
120
|
+
|
|
73
121
|
let tmpValueObject = testFable.services.Utility.createValueObjectByHashes(tmpDataObject, ['Name', 'Age', 'Colors[2]', 'Nonce', 'Details.Height']);
|
|
74
122
|
Expect(tmpValueObject.Name).to.equal('Thee Tortoise and the Hare');
|
|
75
123
|
Expect(tmpValueObject.Age).to.equal(100);
|