From 8c1735cda6ef32b910d6d55aab29b3661f509ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Thu, 29 Sep 2022 00:10:39 +0200 Subject: [PATCH] Extend tests of `str_has_cc` with other control characters The character `\n` was checked redundantly. Now more obscure control characters are also checked instead. --- src/test/str.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/str.cpp b/src/test/str.cpp index 782190edb..eed62c213 100644 --- a/src/test/str.cpp +++ b/src/test/str.cpp @@ -554,7 +554,6 @@ TEST(Str, HasCc) EXPECT_FALSE(str_has_cc("a")); EXPECT_FALSE(str_has_cc("Merhaba dünya!")); - EXPECT_TRUE(str_has_cc("\n")); EXPECT_TRUE(str_has_cc("\n")); EXPECT_TRUE(str_has_cc("\r")); EXPECT_TRUE(str_has_cc("\t")); @@ -562,6 +561,10 @@ TEST(Str, HasCc) EXPECT_TRUE(str_has_cc("a\rb")); EXPECT_TRUE(str_has_cc("\tb")); EXPECT_TRUE(str_has_cc("\n\n")); + EXPECT_TRUE(str_has_cc("\x1C")); + EXPECT_TRUE(str_has_cc("\x1D")); + EXPECT_TRUE(str_has_cc("\x1E")); + EXPECT_TRUE(str_has_cc("\x1F")); } TEST(Str, CompFilename)