Skip to content
Snippets Groups Projects
Commit ccf60bfc authored by Millicent Billette's avatar Millicent Billette
Browse files

WiP: dictionary stuff (dictionary-tree)

parent 4355fd0c
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
......@@ -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']]})));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment