From d233caf8ee94be4c597ad80b5a0c56e13da054cf Mon Sep 17 00:00:00 2001 From: Krishkumar Saini Date: Fri, 6 Feb 2026 06:25:28 +0000 Subject: [PATCH] Add test for copyright detection without year Signed-off-by: Krishkumar Saini --- tests/textcode/copyright_no_year.expected.json | 1 + tests/textcode/copyright_no_year.txt | 1 + tests/textcode/test_strings.py | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 tests/textcode/copyright_no_year.expected.json create mode 100644 tests/textcode/copyright_no_year.txt diff --git a/tests/textcode/copyright_no_year.expected.json b/tests/textcode/copyright_no_year.expected.json new file mode 100644 index 00000000000..0637a088a01 --- /dev/null +++ b/tests/textcode/copyright_no_year.expected.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/textcode/copyright_no_year.txt b/tests/textcode/copyright_no_year.txt new file mode 100644 index 00000000000..705bee2c0f4 --- /dev/null +++ b/tests/textcode/copyright_no_year.txt @@ -0,0 +1 @@ +Copyright The OpenTelemetry Authors diff --git a/tests/textcode/test_strings.py b/tests/textcode/test_strings.py index e174249e99d..88d683eb69f 100644 --- a/tests/textcode/test_strings.py +++ b/tests/textcode/test_strings.py @@ -180,3 +180,11 @@ def test_strings_with_lf(self): test_file = 'strings/with-lf/strings.exe' expected_file = 'strings/with-lf/strings.exe.results' self.check_file_strings(test_file, expected_file, regen=REGEN_TEST_FIXTURES) + + class TestStrings(FileBasedTesting): + + def test_copyright_without_year(self): + self.check_file_strings( + test_file='copyright_no_year.txt', + expected_file='copyright_no_year.expected.json' + ) \ No newline at end of file