From 76638be55229e3e88a088232c77192c94749eda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Alet?= Date: Wed, 20 Apr 2022 08:24:32 +1100 Subject: [PATCH] Added unit tests for issue #452 --- tests/rules/test_key_duplicates.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/rules/test_key_duplicates.py b/tests/rules/test_key_duplicates.py index b325bf6..57a80b8 100644 --- a/tests/rules/test_key_duplicates.py +++ b/tests/rules/test_key_duplicates.py @@ -87,6 +87,10 @@ class KeyDuplicatesTestCase(RuleTestCase): 'anchor_reference:\n' ' <<: *anchor_one\n' ' <<: *anchor_two\n', conf) + self.check('---\n' + '{a:1, b:2}}\n', conf, problem=(2, 11, 'syntax')) + self.check('---\n' + '[a, b, c]]\n', conf, problem=(2, 10, 'syntax')) def test_enabled(self): conf = 'key-duplicates: enable' @@ -165,6 +169,10 @@ class KeyDuplicatesTestCase(RuleTestCase): 'anchor_reference:\n' ' <<: *anchor_one\n' ' <<: *anchor_two\n', conf) + self.check('---\n' + '{a:1, b:2}}\n', conf, problem=(2, 11, 'syntax')) + self.check('---\n' + '[a, b, c]]\n', conf, problem=(2, 10, 'syntax')) def test_key_tokens_in_flow_sequences(self): conf = 'key-duplicates: enable'