From 31f6f191b55d2e8372b22c84e5d8e1b651ca5e46 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Thu, 27 Feb 2025 14:51:21 +0100 Subject: [PATCH] Test standardize --- test/test_standardize.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/test_standardize.py diff --git a/test/test_standardize.py b/test/test_standardize.py new file mode 100644 index 0000000..93478f3 --- /dev/null +++ b/test/test_standardize.py @@ -0,0 +1,35 @@ + +from standardize_test_format import standardize_java_text + + +INPUT_1 = """ +@Test +@DisplayName("Invocations fail with callers without required permissions") +public void selectInvocationWithoutPermission() { } +""" + +OUTPUT_1 = """ +@Test +@DisplayName("Invocations fail with callers without required permissions") +public void selectInvocationWithoutPermission() { } +""" + +INPUT_2 = """ +/** Invocations fail with callers without required permissions. */ +@Test +public void selectInvocationWithoutPermission() { } +""" + +OUTPUT_2 = """ +@Test +@DisplayName("Invocations fail with callers without required permissions") +public void selectInvocationWithoutPermission() { } +""" + +def test_1(): + assert standardize_java_text(INPUT_1) == OUTPUT_1 + +def test_2(): + assert standardize_java_text(INPUT_2) == OUTPUT_2 + +