Skip to content

Commit 90d5c2b

Browse files
authored
Merge pull request #48 from BigglesworthCat/grep
`grep`
2 parents 14c45aa + 5c9bdc5 commit 90d5c2b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

text/tests/grep/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ fn test_stdin_and_file_input() {
963963
grep_test(
964964
&[BRE, "-", INPUT_FILE_1, INPUT_FILE_2],
965965
LINES_INPUT,
966-
"(standard input):line_{1}\n(standard input):p_line_{2}_s\n(standard input): line_{3} \n(standard input):line_{70}\ntests/grep/f_1:line_{1}\r\ntests/grep/f_1:p_line_{2}_s\r\ntests/grep/f_1: line_{3} \r\ntests/grep/f_1:line_{70}\r\n",
966+
"(standard input):line_{1}\n(standard input):p_line_{2}_s\n(standard input): line_{3} \n(standard input):line_{70}\ntests/grep/f_1:line_{1}\ntests/grep/f_1:p_line_{2}_s\ntests/grep/f_1: line_{3} \ntests/grep/f_1:line_{70}\n",
967967
"",
968968
0,
969969
);
@@ -1004,13 +1004,13 @@ fn test_stdin_and_input_files_quiet() {
10041004

10051005
#[test]
10061006
fn test_stdin_and_input_files_other_options() {
1007-
grep_test(&["-insvx", BRE, "-", INPUT_FILE_1, BAD_INPUT_FILE], LINES_INPUT, "(standard input):2:p_line_{2}_s\n(standard input):3: line_{3} \n(standard input):5:p_LINE_{5}_s\n(standard input):6:l_{6}\ntests/grep/f_1:1:line_{1}\r\ntests/grep/f_1:2:p_line_{2}_s\r\ntests/grep/f_1:3: line_{3} \r\ntests/grep/f_1:4:LINE_{4}\r\ntests/grep/f_1:5:p_LINE_{5}_s\r\ntests/grep/f_1:6:l_{6}\r\ntests/grep/f_1:7:line_{70}\r\n", "", 2);
1007+
grep_test(&["-insvx", BRE, "-", INPUT_FILE_1, BAD_INPUT_FILE], LINES_INPUT, "(standard input):2:p_line_{2}_s\n(standard input):3: line_{3} \n(standard input):5:p_LINE_{5}_s\n(standard input):6:l_{6}\ntests/grep/f_1:2:p_line_{2}_s\ntests/grep/f_1:3: line_{3} \ntests/grep/f_1:5:p_LINE_{5}_s\ntests/grep/f_1:6:l_{6}\n", "", 2);
10081008
}
10091009

10101010
#[test]
10111011
fn test_multiple_input_files() {
10121012
grep_test(&[r#"2[[:punct:]]"#, INPUT_FILE_1, INPUT_FILE_2, INPUT_FILE_3], LINES_INPUT,
1013-
"tests/grep/f_1:p_line_{2}_s\r\ntests/grep/f_2:void func2() {\r\ntests/grep/f_2: printf(\"This is function 2\\n\");\r\n", "", 0);
1013+
"tests/grep/f_1:p_line_{2}_s\ntests/grep/f_2:void func2() {\ntests/grep/f_2: printf(\"This is function 2\\n\");\n", "", 0);
10141014
}
10151015

10161016
#[test]
@@ -1067,15 +1067,15 @@ fn test_multiple_input_files_quiet() {
10671067
#[test]
10681068
fn test_multiple_input_files_line_number() {
10691069
grep_test(&["-n", r#"2[[:punct:]]"#, INPUT_FILE_1, INPUT_FILE_2, INPUT_FILE_3], LINES_INPUT,
1070-
"tests/grep/f_1:2:p_line_{2}_s\r\ntests/grep/f_2:12:void func2() {\r\ntests/grep/f_2:13: printf(\"This is function 2\\n\");\r\n", "", 0);
1070+
"tests/grep/f_1:2:p_line_{2}_s\ntests/grep/f_2:12:void func2() {\ntests/grep/f_2:13: printf(\"This is function 2\\n\");\n", "", 0);
10711071
}
10721072

10731073
#[test]
10741074
fn test_duplicate_input_files() {
10751075
grep_test(
10761076
&["-n", r#"2[[:punct:]]"#, INPUT_FILE_1, INPUT_FILE_1],
10771077
LINES_INPUT,
1078-
"tests/grep/f_1:2:p_line_{2}_s\r\ntests/grep/f_1:2:p_line_{2}_s\r\n",
1078+
"tests/grep/f_1:2:p_line_{2}_s\ntests/grep/f_1:2:p_line_{2}_s\n",
10791079
"",
10801080
0,
10811081
);
@@ -1116,7 +1116,7 @@ fn test_duplicate_input_files_quiet() {
11161116

11171117
#[test]
11181118
fn test_muptiple_pattern_files_multiple_input_files() {
1119-
grep_test(&["-f", BRE_FILE_1, "-f", BRE_FILE_2, INPUT_FILE_1, INPUT_FILE_2, INPUT_FILE_3], LINES_INPUT, "tests/grep/f_1:line_{1}\r\ntests/grep/f_1:p_line_{2}_s\r\ntests/grep/f_1: line_{3} \r\ntests/grep/f_1:line_{70}\r\ntests/grep/f_2:#include <stdio.h>\r\ntests/grep/f_2:void func1() {\r\ntests/grep/f_2:void func2() {\r\n", "", 0);
1119+
grep_test(&["-f", BRE_FILE_1, "-f", BRE_FILE_2, INPUT_FILE_1, INPUT_FILE_2, INPUT_FILE_3], LINES_INPUT, "tests/grep/f_1:line_{1}\ntests/grep/f_1:p_line_{2}_s\ntests/grep/f_1: line_{3} \ntests/grep/f_1:line_{70}\ntests/grep/f_2:#include <stdio.h>\ntests/grep/f_2:void func1() {\ntests/grep/f_2:void func2() {\n", "", 0);
11201120
}
11211121

11221122
#[test]
@@ -1181,7 +1181,7 @@ fn test_muptiple_pattern_files_multiple_input_files_quiet() {
11811181

11821182
#[test]
11831183
fn test_muptiple_pattern_files_multiple_input_files_line_number() {
1184-
grep_test(&["-n", "-f", BRE_FILE_1, "-f", BRE_FILE_2, INPUT_FILE_1, INPUT_FILE_2, INPUT_FILE_3], LINES_INPUT, "tests/grep/f_1:1:line_{1}\r\ntests/grep/f_1:2:p_line_{2}_s\r\ntests/grep/f_1:3: line_{3} \r\ntests/grep/f_1:7:line_{70}\r\ntests/grep/f_2:1:#include <stdio.h>\r\ntests/grep/f_2:8:void func1() {\r\ntests/grep/f_2:12:void func2() {\r\n", "", 0);
1184+
grep_test(&["-n", "-f", BRE_FILE_1, "-f", BRE_FILE_2, INPUT_FILE_1, INPUT_FILE_2, INPUT_FILE_3], LINES_INPUT, "tests/grep/f_1:1:line_{1}\ntests/grep/f_1:2:p_line_{2}_s\ntests/grep/f_1:3: line_{3} \ntests/grep/f_1:7:line_{70}\ntests/grep/f_2:1:#include <stdio.h>\ntests/grep/f_2:8:void func1() {\ntests/grep/f_2:12:void func2() {\n", "", 0);
11851185
}
11861186

11871187
#[test]
@@ -1368,7 +1368,7 @@ fn test_long_names_files() {
13681368
INPUT_FILE_2,
13691369
],
13701370
LINES_INPUT,
1371-
"tests/grep/f_1:line_{1}\r\ntests/grep/f_1:p_line_{2}_s\r\ntests/grep/f_1: line_{3} \r\ntests/grep/f_1:line_{70}\r\n",
1371+
"tests/grep/f_1:line_{1}\ntests/grep/f_1:p_line_{2}_s\ntests/grep/f_1: line_{3} \ntests/grep/f_1:line_{70}\n",
13721372
"",
13731373
0,
13741374
);

0 commit comments

Comments
 (0)