Skip to content

Commit d0f81e7

Browse files
committed
Add test for unclosed functions and simple blocks
1 parent 6b62e5e commit d0f81e7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

__tests__/value.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,10 @@ describe('simple blocks', () => {
756756
test('invalid', () => {
757757
expect(parse('(a)', '[a]', false)).toBeNull()
758758
})
759+
test('valid', () => {
760+
// Unclosed (parse error)
761+
expect(parse('(a)', '(a')).toBe('(a)')
762+
})
759763
})
760764
describe('functions', () => {
761765
test('invalid', () => {
@@ -775,8 +779,10 @@ describe('functions', () => {
775779
})
776780
test('valid', () => {
777781
const valid = [
782+
// Unclosed (parse error)
783+
['fn()', 'fn(', 'fn()'],
778784
// Case-insensitive name
779-
['function(a)', 'FUNction(a)', 'function(a)'],
785+
['fn(a)', 'FN(a)', 'fn(a)'],
780786
// Comma-containing production
781787
['fn([<declaration-value>?]#)', 'fn({}, , { a }, { , }, {{}})', 'fn(,, a, {,}, {{}})'],
782788
['fn(<declaration-value>?, a)', 'fn(, a)'],

0 commit comments

Comments
 (0)