mirror of
https://github.com/voson-wang/toon.git
synced 2026-01-29 23:34:10 +08:00
test: reorganize validation and error handling tests
This commit is contained in:
@@ -473,7 +473,8 @@ describe('length marker option', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('error handling', () => {
|
describe('validation and error handling', () => {
|
||||||
|
describe('length and structure errors', () => {
|
||||||
it('throws on array length mismatch (inline primitives)', () => {
|
it('throws on array length mismatch (inline primitives)', () => {
|
||||||
const toon = 'tags[2]: a,b,c'
|
const toon = 'tags[2]: a,b,c'
|
||||||
expect(() => decode(toon)).toThrow()
|
expect(() => decode(toon)).toThrow()
|
||||||
@@ -603,8 +604,8 @@ describe('strict mode: indentation validation', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('blank lines in arrays', () => {
|
describe('strict mode: blank lines in arrays', () => {
|
||||||
describe('strict mode: errors on blank lines inside arrays', () => {
|
describe('errors on blank lines inside arrays', () => {
|
||||||
it('throws on blank line inside list array', () => {
|
it('throws on blank line inside list array', () => {
|
||||||
const teon = 'items[3]:\n - a\n\n - b\n - c'
|
const teon = 'items[3]:\n - a\n\n - b\n - c'
|
||||||
expect(() => decode(teon)).toThrow(/blank line/i)
|
expect(() => decode(teon)).toThrow(/blank line/i)
|
||||||
@@ -682,3 +683,4 @@ describe('blank lines in arrays', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user