tests: add match() - surf-adblock - Surf adblock web extension | |
git clone git://git.codemadness.org/surf-adblock | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit ede99e9ea359312250db995e663de8ce73405f62 | |
parent 3cc61dad61ee13b47cc3b6a2931de9413c4c6176 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Mon, 5 Jun 2017 17:37:19 +0200 | |
tests: add match() | |
Diffstat: | |
A tests/match.c | 51 +++++++++++++++++++++++++++++… | |
1 file changed, 51 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/tests/match.c b/tests/match.c | |
@@ -0,0 +1,51 @@ | |
+#include "../adblock.c" | |
+ | |
+int | |
+main(void) | |
+{ | |
+ int m; | |
+ | |
+ m = match("a", "a", 1); | |
+ printf("%d = 0\n", m); | |
+ | |
+ m = match("a*", "a", 1); | |
+ printf("%d = 0\n", m); | |
+ | |
+ m = match("*a", "a", 1); | |
+ printf("%d = 0\n", m); | |
+ | |
+ m = match("*a*", "a", 1); | |
+ printf("%d = 0\n", m); | |
+ | |
+ m = match("^*", "/index.html", 1); | |
+ printf("%d = 0\n", m); | |
+ | |
+ m = match("*^*", "/index.html", 1); | |
+ printf("%d = 0\n", m); | |
+ | |
+ m = match("*^*", "a/index.html", 1); | |
+ printf("%d = 0\n", m); | |
+ | |
+ m = match("*/*", "a/index.html", 1); | |
+ printf("%d = 0\n", m); | |
+ | |
+ m = match("*^i*", "a/index.html", 1); | |
+ printf("%d = 0\n", m); | |
+ | |
+ m = match("a^i*", "a/index.html", 1); | |
+ printf("%d = 0\n", m); | |
+ | |
+ m = match("b^i*", "a/index.html", 1); | |
+ printf("%d = 1\n", m); | |
+ | |
+ m = match("a^^i*", "a/index.html", 1); | |
+ printf("%d = 1\n", m); | |
+ | |
+ m = match("^^i*", "a/index.html", 1); | |
+ printf("%d = 1\n", m); | |
+ | |
+ m = match("^^i*", "a/index.html", 1); | |
+ printf("%d = 1\n", m); | |
+ | |
+ return 0; | |
+} |