mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
ptx: ignore empty regex (#1808)
* ptx: ignore empty -W regex * ptx: test to verify empty -W regex is ignored * tests/ptx: verify word regexp from cmd-line is used
This commit is contained in:
parent
5ced3a670b
commit
e1626b8c64
3 changed files with 37 additions and 5 deletions
|
@ -8,6 +8,22 @@ fn gnu_ext_disabled_roff_no_ref() {
|
|||
.stdout_only_fixture("gnu_ext_disabled_roff_no_ref.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gnu_ext_disabled_roff_no_ref_empty_word_regexp() {
|
||||
new_ucmd!()
|
||||
.args(&["-G", "-R", "-W", "", "input"])
|
||||
.succeeds()
|
||||
.stdout_only_fixture("gnu_ext_disabled_roff_no_ref.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gnu_ext_disabled_roff_no_ref_word_regexp_exc_space() {
|
||||
new_ucmd!()
|
||||
.args(&["-G", "-R", "-W", "[^\t\n]+", "input"])
|
||||
.succeeds()
|
||||
.stdout_only_fixture("gnu_ext_disabled_roff_no_ref_word_regexp_exc_space.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gnu_ext_disabled_roff_input_ref() {
|
||||
new_ucmd!()
|
||||
|
|
7
tests/fixtures/ptx/gnu_ext_disabled_roff_no_ref_word_regexp_exc_space.expected
vendored
Normal file
7
tests/fixtures/ptx/gnu_ext_disabled_roff_no_ref_word_regexp_exc_space.expected
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
.xx "" "" """quotes"", for roff" ""
|
||||
.xx "" "" "and some other like %a, b#, c$c" ""
|
||||
.xx "" "" "hello world!" ""
|
||||
.xx "" "" "let's check special characters:" ""
|
||||
.xx "" "" "maybe also~or^" ""
|
||||
.xx "" "" "oh, and back\slash" ""
|
||||
.xx "" "" "{brackets} for tex" ""
|
Loading…
Add table
Add a link
Reference in a new issue