diff --git a/package.json b/package.json index c3957a7d63c455dd20283ce7b091c0c63ae5f47f..8d5e9a5f97476ee2db8a7c92b5993f83b2afc1ed 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "xo": { "rules": { "curly": 0, + "ava/no-inline-assertions": 0, "unicorn/no-reduce": 0, "unicorn/no-array-reduce": 0, "unicorn/no-array-for-each": 0, diff --git a/src/dictionary-tree.test.mjs b/src/dictionary-tree.test.mjs index 620877b19351df2175733cd2a6af79b9a51c47c6..b9ff604f3894bcc4d4253a9dc4ca416221999463 100644 --- a/src/dictionary-tree.test.mjs +++ b/src/dictionary-tree.test.mjs @@ -6,9 +6,9 @@ const expected = str => JSON.stringify(str); test('simple string still simple string', t => t.is(buildTreeStruct('abc'), expected('abc'))); test('(a|b) alt as array', t => t.is(buildTreeStruct('(a|b)'), expected(['a', 'b']))); -//test('a) throw',t=>t.throws(()=>buildTreeStruct('a)'))); -//test('(a throw',t=>t.throws(()=>buildTreeStruct('(a'))); -//test('a|b throw',t=>t.throws(()=>buildTreeStruct('a|b'))); +// Ok to be permissive test('a) throw',t=>t.throws(()=>buildTreeStruct('a)'))); +// Ok to be permissive test('(a throw',t=>t.throws(()=>buildTreeStruct('(a'))); +// Ok to be permissive test('a|b throw',t=>t.throws(()=>buildTreeStruct('a|b'))); test('(|b) empty choice is choice', t => t.is(buildTreeStruct('(|b)'), expected(['', 'b']))); test('(b|b) trivial dedup', t => t.is(buildTreeStruct('(|b||b|)'), expected(['', 'b']))); test('a(b|c) ordered part in step obj', t => t.is(buildTreeStruct('a(b|c)'), expected({step: ['a', ['b', 'c']]})));