From 455924e22fbb7dc4e59f8e9fb3e2f27e440ddf47 Mon Sep 17 00:00:00 2001 From: James Westman Date: Sat, 16 Sep 2023 14:01:18 -0500 Subject: [PATCH] tests: Add another formatter test --- tests/formatting/correct1.blp | 18 ++++++++++++++++++ tests/test_formatter.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/formatting/correct1.blp diff --git a/tests/formatting/correct1.blp b/tests/formatting/correct1.blp new file mode 100644 index 0000000..4646bac --- /dev/null +++ b/tests/formatting/correct1.blp @@ -0,0 +1,18 @@ +using Gtk 4.0; + +template $MyTemplate: Label { + /** + * A list of strings. + */ + StringList { + // comment + strings [ + 'Hello', + C_('Greeting', 'World'), + ] + } + + object: Button { + label: 'Click me'; + }; +} diff --git a/tests/test_formatter.py b/tests/test_formatter.py index ff4ed36..65e865e 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -18,7 +18,6 @@ # SPDX-License-Identifier: LGPL-3.0-or-later -import difflib import unittest from pathlib import Path @@ -45,3 +44,4 @@ class TestFormatter(unittest.TestCase): def test_formatter(self): self.assert_format_test("in1.blp", "out.blp") self.assert_format_test("in2.blp", "out.blp") + self.assert_format_test("correct1.blp", "correct1.blp")