Added a few more test cases

Making sure multi-line empty dicts/arrays with and without comments
still properly pass when `forbid: non-empty` is set.
pull/346/head
Rusty Geldmacher 4 years ago
parent c897bf76a1
commit 8a04bdc871

@ -68,6 +68,14 @@ class ColonTestCase(RuleTestCase):
' a: 1\n', conf) ' a: 1\n', conf)
self.check('---\n' self.check('---\n'
'dict: {}\n', conf) 'dict: {}\n', conf)
self.check('---\n'
'dict: {\n'
'}\n', conf)
self.check('---\n'
'dict: {\n'
'# commented: value\n'
'# another: value2\n'
'}\n', conf)
self.check('---\n' self.check('---\n'
'dict: {a}\n', conf, problem=(2, 8)) 'dict: {a}\n', conf, problem=(2, 8))
self.check('---\n' self.check('---\n'

@ -68,6 +68,13 @@ class ColonTestCase(RuleTestCase):
' - b\n', conf) ' - b\n', conf)
self.check('---\n' self.check('---\n'
'array: []\n', conf) 'array: []\n', conf)
self.check('---\n'
'array: [\n\n'
']\n', conf)
self.check('---\n'
'array: [\n'
'# a comment\n'
']\n', conf)
self.check('---\n' self.check('---\n'
'array: [a, b]\n', conf, problem=(2, 9)) 'array: [a, b]\n', conf, problem=(2, 9))
self.check('---\n' self.check('---\n'

Loading…
Cancel
Save