Skip to content

Commit

Permalink
chore: Add test for #467 - dedent not working
Browse files Browse the repository at this point in the history
  • Loading branch information
pdubroy committed Mar 17, 2024
1 parent 838e422 commit 65e641a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/ohm-js/test/test-indentation-sensitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,33 @@ test('basic tracing', t => {
t.is(indent.toString(), 'x ✓ indent ⇒ ""\nx ✓ indent ⇒ ""\n');
t.is(dedent.toString(), ' ✓ dedent ⇒ ""\n ✓ dedent ⇒ ""\n');
});

// eslint-disable-next-line ava/no-skip-test
test.skip('#467 - dedent not working', t => {
const g = grammar(
`
G <: IndentationSensitive {
IfExpr = "if" Expr ":" Block
Block = indent Expr+ dedent
Expr = IfExpr
| "True2"
| "True3"
| "True"
| "False"
| number
number = digit+
}
`,
{IndentationSensitive},
);
const input = `
if True:
if True2:
2
if True3:
3
`.trim();
const result = g.trace(input);
t.true(result.succeeded());
});

0 comments on commit 65e641a

Please sign in to comment.