forked from uutils/coreutils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_ptx.rs
114 lines (100 loc) · 3.08 KB
/
test_ptx.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// This file is part of the uutils coreutils package.
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
}
#[test]
fn gnu_ext_disabled_rightward_no_ref() {
new_ucmd!()
.args(&["-G", "-R", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_rightward_no_ref.expected");
}
#[test]
fn gnu_ext_disabled_rightward_no_ref_empty_word_regexp() {
new_ucmd!()
.args(&["-G", "-R", "-W", "", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_rightward_no_ref.expected");
}
#[test]
fn gnu_ext_disabled_rightward_no_ref_word_regexp_exc_space() {
new_ucmd!()
.args(&["-G", "-R", "-W", "[^\t\n]+", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_rightward_no_ref_word_regexp_exc_space.expected");
}
#[test]
fn gnu_ext_disabled_rightward_input_ref() {
new_ucmd!()
.args(&["-G", "-r", "-R", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_rightward_input_ref.expected");
}
#[test]
fn gnu_ext_disabled_rightward_auto_ref() {
new_ucmd!()
.args(&["-G", "-A", "-R", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_rightward_auto_ref.expected");
}
#[test]
fn gnu_ext_disabled_tex_no_ref() {
new_ucmd!()
.args(&["-G", "-T", "-R", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_tex_no_ref.expected");
}
#[test]
fn gnu_ext_disabled_tex_input_ref() {
new_ucmd!()
.args(&["-G", "-T", "-r", "-R", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_tex_input_ref.expected");
}
#[test]
fn gnu_ext_disabled_tex_auto_ref() {
new_ucmd!()
.args(&["-G", "-T", "-A", "-R", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_tex_auto_ref.expected");
}
#[test]
fn gnu_ext_disabled_ignore_and_only_file() {
new_ucmd!()
.args(&["-G", "-o", "only", "-i", "ignore", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_ignore_and_only_file.expected");
}
#[test]
fn gnu_ext_disabled_output_width_50() {
new_ucmd!()
.args(&["-G", "-w", "50", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_output_width_50.expected");
}
#[test]
fn gnu_ext_disabled_output_width_70() {
new_ucmd!()
.args(&["-G", "-w", "70", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_output_width_70.expected");
}
#[test]
fn gnu_ext_disabled_break_file() {
new_ucmd!()
.args(&["-G", "-b", "break_file", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_break_file.expected");
}
#[test]
fn gnu_ext_disabled_empty_word_regexp_ignores_break_file() {
new_ucmd!()
.args(&["-G", "-b", "break_file", "-R", "-W", "", "input"])
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_rightward_no_ref.expected");
}