|
|
|
@ -32,11 +32,19 @@ class ColonTestCase(RuleTestCase):
|
|
|
|
|
'dict7: { a: 1, b, c: 3 }\n', conf)
|
|
|
|
|
|
|
|
|
|
def test_min_spaces(self):
|
|
|
|
|
conf = 'braces: {max-spaces-inside: -1, min-spaces-inside: 0}'
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: 0\n'
|
|
|
|
|
' max-spaces-inside-empty: -1\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: {}\n', conf)
|
|
|
|
|
|
|
|
|
|
conf = 'braces: {max-spaces-inside: -1, min-spaces-inside: 1}'
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: 1\n'
|
|
|
|
|
' max-spaces-inside-empty: -1\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: {}\n', conf, problem=(2, 8))
|
|
|
|
|
self.check('---\n'
|
|
|
|
@ -52,7 +60,11 @@ class ColonTestCase(RuleTestCase):
|
|
|
|
|
' b\n'
|
|
|
|
|
'}\n', conf)
|
|
|
|
|
|
|
|
|
|
conf = 'braces: {max-spaces-inside: -1, min-spaces-inside: 3}'
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: 3\n'
|
|
|
|
|
' max-spaces-inside-empty: -1\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: { a: 1, b }\n', conf,
|
|
|
|
|
problem1=(2, 9), problem2=(2, 17))
|
|
|
|
@ -60,7 +72,11 @@ class ColonTestCase(RuleTestCase):
|
|
|
|
|
'dict: { a: 1, b }\n', conf)
|
|
|
|
|
|
|
|
|
|
def test_max_spaces(self):
|
|
|
|
|
conf = 'braces: {max-spaces-inside: 0, min-spaces-inside: -1}'
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: 0\n'
|
|
|
|
|
' min-spaces-inside: -1\n'
|
|
|
|
|
' max-spaces-inside-empty: -1\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: {}\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
@ -79,7 +95,11 @@ class ColonTestCase(RuleTestCase):
|
|
|
|
|
' b\n'
|
|
|
|
|
'}\n', conf)
|
|
|
|
|
|
|
|
|
|
conf = 'braces: {max-spaces-inside: 3, min-spaces-inside: -1}'
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: 3\n'
|
|
|
|
|
' min-spaces-inside: -1\n'
|
|
|
|
|
' max-spaces-inside-empty: -1\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: { a: 1, b }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
@ -87,7 +107,11 @@ class ColonTestCase(RuleTestCase):
|
|
|
|
|
problem1=(2, 11), problem2=(2, 23))
|
|
|
|
|
|
|
|
|
|
def test_min_and_max_spaces(self):
|
|
|
|
|
conf = 'braces: {max-spaces-inside: 0, min-spaces-inside: 0}'
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: 0\n'
|
|
|
|
|
' min-spaces-inside: 0\n'
|
|
|
|
|
' max-spaces-inside-empty: -1\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: {}\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
@ -95,14 +119,169 @@ class ColonTestCase(RuleTestCase):
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: { a: 1, b}\n', conf, problem=(2, 10))
|
|
|
|
|
|
|
|
|
|
conf = 'braces: {max-spaces-inside: 1, min-spaces-inside: 1}'
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: 1\n'
|
|
|
|
|
' min-spaces-inside: 1\n'
|
|
|
|
|
' max-spaces-inside-empty: -1\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: {a: 1, b, c: 3 }\n', conf, problem=(2, 8))
|
|
|
|
|
|
|
|
|
|
conf = 'braces: {max-spaces-inside: 2, min-spaces-inside: 0}'
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: 2\n'
|
|
|
|
|
' min-spaces-inside: 0\n'
|
|
|
|
|
' max-spaces-inside-empty: -1\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: {a: 1, b, c: 3 }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: { a: 1, b, c: 3 }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'dict: { a: 1, b, c: 3 }\n', conf, problem=(2, 10))
|
|
|
|
|
|
|
|
|
|
def test_min_spaces_empty(self):
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: -1\n'
|
|
|
|
|
' max-spaces-inside-empty: 0\n'
|
|
|
|
|
' min-spaces-inside-empty: 0\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf)
|
|
|
|
|
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: -1\n'
|
|
|
|
|
' max-spaces-inside-empty: -1\n'
|
|
|
|
|
' min-spaces-inside-empty: 1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf, problem=(2, 9))
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf)
|
|
|
|
|
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: -1\n'
|
|
|
|
|
' max-spaces-inside-empty: -1\n'
|
|
|
|
|
' min-spaces-inside-empty: 3\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf, problem=(2, 9))
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf)
|
|
|
|
|
|
|
|
|
|
def test_max_spaces_empty(self):
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: -1\n'
|
|
|
|
|
' max-spaces-inside-empty: 0\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf, problem=(2, 9))
|
|
|
|
|
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: -1\n'
|
|
|
|
|
' max-spaces-inside-empty: 1\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf, problem=(2, 10))
|
|
|
|
|
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: -1\n'
|
|
|
|
|
' max-spaces-inside-empty: 3\n'
|
|
|
|
|
' min-spaces-inside-empty: -1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf, problem=(2, 12))
|
|
|
|
|
|
|
|
|
|
def test_min_and_max_spaces_empty(self):
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: -1\n'
|
|
|
|
|
' max-spaces-inside-empty: 2\n'
|
|
|
|
|
' min-spaces-inside-empty: 1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf, problem=(2, 9))
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf, problem=(2, 11))
|
|
|
|
|
|
|
|
|
|
def test_mixed_empty_nonempty(self):
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: -1\n'
|
|
|
|
|
' min-spaces-inside: 1\n'
|
|
|
|
|
' max-spaces-inside-empty: 0\n'
|
|
|
|
|
' min-spaces-inside-empty: 0\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { a: 1, b }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {a: 1, b}\n', conf,
|
|
|
|
|
problem1=(2, 9), problem2=(2, 16))
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf,
|
|
|
|
|
problem1=(2, 9))
|
|
|
|
|
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: 0\n'
|
|
|
|
|
' min-spaces-inside: -1\n'
|
|
|
|
|
' max-spaces-inside-empty: 1\n'
|
|
|
|
|
' min-spaces-inside-empty: 1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { a: 1, b }\n', conf,
|
|
|
|
|
problem1=(2, 9), problem2=(2, 17))
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {a: 1, b}\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf,
|
|
|
|
|
problem1=(2, 9))
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf)
|
|
|
|
|
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: 2\n'
|
|
|
|
|
' min-spaces-inside: 1\n'
|
|
|
|
|
' max-spaces-inside-empty: 1\n'
|
|
|
|
|
' min-spaces-inside-empty: 1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { a: 1, b }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {a: 1, b }\n', conf,
|
|
|
|
|
problem1=(2, 9), problem2=(2, 18))
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf,
|
|
|
|
|
problem1=(2, 9))
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf,
|
|
|
|
|
problem1=(2, 11))
|
|
|
|
|
|
|
|
|
|
conf = ('braces:\n'
|
|
|
|
|
' max-spaces-inside: 1\n'
|
|
|
|
|
' min-spaces-inside: 1\n'
|
|
|
|
|
' max-spaces-inside-empty: 1\n'
|
|
|
|
|
' min-spaces-inside-empty: 1\n')
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { a: 1, b }\n', conf)
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {a: 1, b}\n', conf,
|
|
|
|
|
problem1=(2, 9), problem2=(2, 16))
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: {}\n', conf,
|
|
|
|
|
problem1=(2, 9))
|
|
|
|
|
self.check('---\n'
|
|
|
|
|
'array: { }\n', conf)
|
|
|
|
|