git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
60452a3
)
test-regex: isolate the bug test code
author
Nguyễn Thái Ngọc Duy
<redacted>
Sat, 25 Jun 2016 05:22:28 +0000
(07:22 +0200)
committer
Junio C Hamano
<redacted>
Mon, 27 Jun 2016 14:31:35 +0000
(07:31 -0700)
This is in preparation to turn test-regex into some generic regex
testing command.
Helped-by: Eric Sunshine <redacted>
Helped-by: Ramsay Jones <redacted>
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
t/t0070-fundamental.sh
patch
|
blob
|
history
test-regex.c
patch
|
blob
|
history
diff --git
a/t/t0070-fundamental.sh
b/t/t0070-fundamental.sh
index 5ed69a6f566bf3a7944b41bace4cfbe26d015040..991ed2a48dbf15fb4cb794a587ad900071391e11 100755
(executable)
--- a/
t/t0070-fundamental.sh
+++ b/
t/t0070-fundamental.sh
@@
-31,7
+31,7
@@
test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '
test_expect_success 'check for a bug in the regex routines' '
# if this test fails, re-build git with NO_REGEX=1
- test-regex
+ test-regex
--bug
'
test_done
diff --git
a/test-regex.c
b/test-regex.c
index 0dc598ecdc2696af956b1c517166f9e28b37dc68..67a1a650672478d4453fcfe6272fad4be749fdd4 100644
(file)
--- a/
test-regex.c
+++ b/
test-regex.c
@@
-1,6
+1,6
@@
#include "git-compat-util.h"
-
int main(int argc, char **argv
)
+
static int test_regex_bug(void
)
{
char *pat = "[^={} \t]+";
char *str = "={}\nfred";
@@
-16,5
+16,13
@@
int main(int argc, char **argv)
if (m[0].rm_so == 3) /* matches '\n' when it should not */
die("regex bug confirmed: re-build git with NO_REGEX=1");
- exit(0);
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ if (argc == 2 && !strcmp(argv[1], "--bug"))
+ return test_regex_bug();
+ else
+ usage("test-regex --bug");
}
git clone https://git.99rst.org/PROJECT