Skip to content

Commit

Permalink
do you support this use-case?
Browse files Browse the repository at this point in the history
If the `str` contains more `a` than `b` / there are unmatched pairs, and a and/or b is regex, what's the expected behaviour?
  • Loading branch information
stevemao committed Jul 16, 2016
1 parent 86c146d commit a15af5c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/balanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,12 @@ test('balanced', function(t) {
body: 'in{nest}',
post: 'post'
});
t.deepEqual(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in { nest } post'), {
start: 12,
end: 19,
pre: 'pre { in',
body: 'nest',
post: 'post'
});
t.end();
});

0 comments on commit a15af5c

Please sign in to comment.