Kaynağa Gözat

libdpkg: Add test cases for unmatched str_match_end()

Guillem Jover 12 yıl önce
ebeveyn
işleme
fceb4381db
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      lib/dpkg/test/t-string.c

+ 3 - 1
lib/dpkg/test/t-string.c

@@ -33,6 +33,8 @@ test_str_match_end(void)
 	test_pass(str_match_end("foo bar quux", "quux"));
 	test_pass(str_match_end("foo bar quux", "bar quux"));
 	test_pass(str_match_end("foo bar quux", "foo bar quux"));
+	test_fail(str_match_end("foo bar quux", "foo bar"));
+	test_fail(str_match_end("foo bar quux", "foo"));
 }
 
 static void
@@ -135,7 +137,7 @@ test_str_strip_quotes(void)
 static void
 test(void)
 {
-	test_plan(21);
+	test_plan(23);
 
 	test_str_match_end();
 	test_str_escape_fmt();