From f46ac344717021e5e3ac02ea9e9f3287da49130f Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Thu, 25 Apr 2024 12:21:20 +0200 Subject: [PATCH] add further unit tests --- tests/test_dictParser.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_dictParser.py b/tests/test_dictParser.py index 0a97087..d2d2cdc 100644 --- a/tests/test_dictParser.py +++ b/tests/test_dictParser.py @@ -42,6 +42,28 @@ def parse_and_convert_back(text): assert result_dict == {"p_rgh": "foo bar"} assert result_text == text + text = """p_rgh +{ +\tfoo bar; +} + +""" + + result_dict, result_text = parse_and_convert_back(text) + assert result_dict == {"p_rgh": {"foo": "bar"}} + assert result_text == text + + text = """\"p_rgh|foo|p_bar\" +{ +\tfoo bar; +\t$p; +} + +""" + result_dict, result_text = parse_and_convert_back(text) + assert result_dict == {'"p_rgh|foo|p_bar"': {"foo": "bar", "$_p": "p"}} + assert result_text == text + text = """key { \tfoo bar;