Skip to content

Commit

Permalink
🧪 Add tests with incorrect parse result
Browse files Browse the repository at this point in the history
- we want these to result in errors, but they pass right now
  • Loading branch information
TheAfroOfDoom committed May 20, 2024
1 parent 9addc6c commit ec8760d
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 0 deletions.
12 changes: 12 additions & 0 deletions __snapshots__/packages/core/test-out/parser/util.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions __snapshots__/packages/mcfunction/test-out/parser/command.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/core/test/parser/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ describe('concatOnTrailingBackslash()', () => {
{ content: 'tru\\ \n e' },
{ content: 'tru\\ \n \\\n e' },
{ content: 'tru\\e \\ \n e' },
{ content: 'tru\\\n\ne' },
],
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const Suites: Partial<
'{"text":"hello world"}',
'[""]',
'["hello \\ \nworld"]',
'["hello\\\n\nworld"]',
'["\\u12\\ \n 34"]',
'["\\uab\\ \n nd"]',
],
Expand Down
1 change: 1 addition & 0 deletions packages/mcfunction/test/parser/command.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe('mcfunction parser command()', () => {
{ content: 'sa\\\ny hi' },
{ content: 'sa\\ \n y hi' },
{ content: 'sa\\ \n y h\\ \n i' },
{ content: 'sa\\\n\ny h\\ \n i' },
]
for (const { content } of cases) {
it(`Parse "${showWhitespaceGlyph(content)}"`, () => {
Expand Down

0 comments on commit ec8760d

Please sign in to comment.