clarity-pattern-parser 3.0.13 → 3.0.14
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/index.browser.js +4 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +4 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/patterns/composite/RepeatComposite.ts +2 -1
- package/src/patterns/value/RepeatValue.ts +2 -1
- package/src/tests/TextSuggester.test.ts +12 -14
|
@@ -251,23 +251,21 @@ describe("TextInspector", () => {
|
|
|
251
251
|
expect(inspection.isComplete).toBe(false);
|
|
252
252
|
});
|
|
253
253
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
// const space = new Literal("space", " ");
|
|
260
|
-
// const or = new OrComposite("names", [a, b]);
|
|
254
|
+
test("Suggest another item in the repeat.", () => {
|
|
255
|
+
const a = new Literal("a", "A");
|
|
256
|
+
const b = new Literal("b", "B");
|
|
257
|
+
const space = new Literal("space", " ");
|
|
258
|
+
const or = new OrComposite("names", [a, b]);
|
|
261
259
|
|
|
262
|
-
|
|
260
|
+
const repeat = new RepeatComposite("repeat", or, space);
|
|
263
261
|
|
|
264
|
-
|
|
262
|
+
const result = TextSuggester.suggest("A B ", repeat);
|
|
265
263
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
264
|
+
expect(result.isComplete).toBe(false);
|
|
265
|
+
expect(result.options.values[0]).toBe("A");
|
|
266
|
+
expect(result.options.values[1]).toBe("B");
|
|
267
|
+
expect(result.options.values.length).toBe(2);
|
|
268
|
+
});
|
|
271
269
|
|
|
272
270
|
test("Repeating pattern.", () => {
|
|
273
271
|
const expression = generateExpression(["FlagX", "FlagY", "FlagZ"]);
|