mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Merge pull request #637 from jbcrail/fix-ptx-tests-on-osx
Fix ptx tests on OS X.
This commit is contained in:
commit
369ec58578
8 changed files with 143 additions and 13 deletions
2
test/fixtures/ptx/gnu_ext_disabled_ignore_and_only_file.expected
vendored
Normal file
2
test/fixtures/ptx/gnu_ext_disabled_ignore_and_only_file.expected
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.xx "" """quotes"", for" "roff" ""
|
||||
.xx "" "{brackets} for" "tex" ""
|
24
test/fixtures/ptx/gnu_ext_disabled_roff_auto_ref.expected
vendored
Normal file
24
test/fixtures/ptx/gnu_ext_disabled_roff_auto_ref.expected
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
.xx "" "" """quotes"", for roff" "" "input:3"
|
||||
.xx "" "and some other like" "%a, b#, c$c" "" "input:5"
|
||||
.xx "" "maybe" "also~or^" "" "input:6"
|
||||
.xx "" "" "and some other like %a, b#, c$c" "" "input:5"
|
||||
.xx "" "oh," "and back\slash" "" "input:7"
|
||||
.xx "" "and some other like %a," "b#, c$c" "" "input:5"
|
||||
.xx "" "oh, and" "back\slash" "" "input:7"
|
||||
.xx "" "and some other like %a, b#," "c$c" "" "input:5"
|
||||
.xx "" "let's check special" "characters:" "" "input:2"
|
||||
.xx "" "let's" "check special characters:" "" "input:2"
|
||||
.xx "" """quotes""," "for roff" "" "input:3"
|
||||
.xx "" "{brackets}" "for tex" "" "input:4"
|
||||
.xx "" "" "hello world!" "" "input:1"
|
||||
.xx "" "" "let's check special characters:" "" "input:2"
|
||||
.xx "" "and some other" "like %a, b#, c$c" "" "input:5"
|
||||
.xx "" "" "maybe also~or^" "" "input:6"
|
||||
.xx "" "" "oh, and back\slash" "" "input:7"
|
||||
.xx "" "and some" "other like %a, b#, c$c" "" "input:5"
|
||||
.xx "" """quotes"", for" "roff" "" "input:3"
|
||||
.xx "" "and" "some other like %a, b#, c$c" "" "input:5"
|
||||
.xx "" "let's check" "special characters:" "" "input:2"
|
||||
.xx "" "{brackets} for" "tex" "" "input:4"
|
||||
.xx "" "hello" "world!" "" "input:1"
|
||||
.xx "" "" "{brackets} for tex" "" "input:4"
|
17
test/fixtures/ptx/gnu_ext_disabled_roff_input_ref.expected
vendored
Normal file
17
test/fixtures/ptx/gnu_ext_disabled_roff_input_ref.expected
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
.xx "" "some other like" "%a, b#, c$c" "" "and"
|
||||
.xx "" "" "also~or^" "" "maybe"
|
||||
.xx "" "" "and back\slash" "" "oh,"
|
||||
.xx "" "some other like %a," "b#, c$c" "" "and"
|
||||
.xx "" "and" "back\slash" "" "oh,"
|
||||
.xx "" "some other like %a, b#," "c$c" "" "and"
|
||||
.xx "" "check special" "characters:" "" "let's"
|
||||
.xx "" "" "check special characters:" "" "let's"
|
||||
.xx "" "" "for roff" "" """quotes"","
|
||||
.xx "" "" "for tex" "" "{brackets}"
|
||||
.xx "" "some other" "like %a, b#, c$c" "" "and"
|
||||
.xx "" "some" "other like %a, b#, c$c" "" "and"
|
||||
.xx "" "for" "roff" "" """quotes"","
|
||||
.xx "" "" "some other like %a, b#, c$c" "" "and"
|
||||
.xx "" "check" "special characters:" "" "let's"
|
||||
.xx "" "for" "tex" "" "{brackets}"
|
||||
.xx "" "" "world!" "" "hello"
|
24
test/fixtures/ptx/gnu_ext_disabled_roff_no_ref.expected
vendored
Normal file
24
test/fixtures/ptx/gnu_ext_disabled_roff_no_ref.expected
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
.xx "" "" """quotes"", for roff" ""
|
||||
.xx "" "and some other like" "%a, b#, c$c" ""
|
||||
.xx "" "maybe" "also~or^" ""
|
||||
.xx "" "" "and some other like %a, b#, c$c" ""
|
||||
.xx "" "oh," "and back\slash" ""
|
||||
.xx "" "and some other like %a," "b#, c$c" ""
|
||||
.xx "" "oh, and" "back\slash" ""
|
||||
.xx "" "and some other like %a, b#," "c$c" ""
|
||||
.xx "" "let's check special" "characters:" ""
|
||||
.xx "" "let's" "check special characters:" ""
|
||||
.xx "" """quotes""," "for roff" ""
|
||||
.xx "" "{brackets}" "for tex" ""
|
||||
.xx "" "" "hello world!" ""
|
||||
.xx "" "" "let's check special characters:" ""
|
||||
.xx "" "and some other" "like %a, b#, c$c" ""
|
||||
.xx "" "" "maybe also~or^" ""
|
||||
.xx "" "" "oh, and back\slash" ""
|
||||
.xx "" "and some" "other like %a, b#, c$c" ""
|
||||
.xx "" """quotes"", for" "roff" ""
|
||||
.xx "" "and" "some other like %a, b#, c$c" ""
|
||||
.xx "" "let's check" "special characters:" ""
|
||||
.xx "" "{brackets} for" "tex" ""
|
||||
.xx "" "hello" "world!" ""
|
||||
.xx "" "" "{brackets} for tex" ""
|
24
test/fixtures/ptx/gnu_ext_disabled_tex_auto_ref.expected
vendored
Normal file
24
test/fixtures/ptx/gnu_ext_disabled_tex_auto_ref.expected
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
\xx {}{}{"quotes",}{ for roff}{}{input:3}
|
||||
\xx {}{and some other like}{\%a,}{ b\#, c\$c}{}{input:5}
|
||||
\xx {}{maybe}{also~or^}{}{}{input:6}
|
||||
\xx {}{}{and}{ some other like \%a, b\#, c\$c}{}{input:5}
|
||||
\xx {}{oh,}{and}{ back\backslash{}slash}{}{input:7}
|
||||
\xx {}{and some other like \%a,}{b\#,}{ c\$c}{}{input:5}
|
||||
\xx {}{oh, and}{back\backslash{}slash}{}{}{input:7}
|
||||
\xx {}{and some other like \%a, b\#,}{c\$c}{}{}{input:5}
|
||||
\xx {}{let's check special}{characters:}{}{}{input:2}
|
||||
\xx {}{let's}{check}{ special characters:}{}{input:2}
|
||||
\xx {}{"quotes",}{for}{ roff}{}{input:3}
|
||||
\xx {}{$\{$brackets$\}$}{for}{ tex}{}{input:4}
|
||||
\xx {}{}{hello}{ world!}{}{input:1}
|
||||
\xx {}{}{let's}{ check special characters:}{}{input:2}
|
||||
\xx {}{and some other}{like}{ \%a, b\#, c\$c}{}{input:5}
|
||||
\xx {}{}{maybe}{ also~or^}{}{input:6}
|
||||
\xx {}{}{oh,}{ and back\backslash{}slash}{}{input:7}
|
||||
\xx {}{and some}{other}{ like \%a, b\#, c\$c}{}{input:5}
|
||||
\xx {}{"quotes", for}{roff}{}{}{input:3}
|
||||
\xx {}{and}{some}{ other like \%a, b\#, c\$c}{}{input:5}
|
||||
\xx {}{let's check}{special}{ characters:}{}{input:2}
|
||||
\xx {}{$\{$brackets$\}$ for}{tex}{}{}{input:4}
|
||||
\xx {}{hello}{world!}{}{}{input:1}
|
||||
\xx {}{}{$\{$brackets$\}$}{ for tex}{}{input:4}
|
17
test/fixtures/ptx/gnu_ext_disabled_tex_input_ref.expected
vendored
Normal file
17
test/fixtures/ptx/gnu_ext_disabled_tex_input_ref.expected
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
\xx {}{some other like}{\%a,}{ b\#, c\$c}{}{and}
|
||||
\xx {}{}{also~or^}{}{}{maybe}
|
||||
\xx {}{}{and}{ back\backslash{}slash}{}{oh,}
|
||||
\xx {}{some other like \%a,}{b\#,}{ c\$c}{}{and}
|
||||
\xx {}{and}{back\backslash{}slash}{}{}{oh,}
|
||||
\xx {}{some other like \%a, b\#,}{c\$c}{}{}{and}
|
||||
\xx {}{check special}{characters:}{}{}{let's}
|
||||
\xx {}{}{check}{ special characters:}{}{let's}
|
||||
\xx {}{}{for}{ roff}{}{"quotes",}
|
||||
\xx {}{}{for}{ tex}{}{$\{$brackets$\}$}
|
||||
\xx {}{some other}{like}{ \%a, b\#, c\$c}{}{and}
|
||||
\xx {}{some}{other}{ like \%a, b\#, c\$c}{}{and}
|
||||
\xx {}{for}{roff}{}{}{"quotes",}
|
||||
\xx {}{}{some}{ other like \%a, b\#, c\$c}{}{and}
|
||||
\xx {}{check}{special}{ characters:}{}{let's}
|
||||
\xx {}{for}{tex}{}{}{$\{$brackets$\}$}
|
||||
\xx {}{}{world!}{}{}{hello}
|
24
test/fixtures/ptx/gnu_ext_disabled_tex_no_ref.expected
vendored
Normal file
24
test/fixtures/ptx/gnu_ext_disabled_tex_no_ref.expected
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
\xx {}{}{"quotes",}{ for roff}{}
|
||||
\xx {}{and some other like}{\%a,}{ b\#, c\$c}{}
|
||||
\xx {}{maybe}{also~or^}{}{}
|
||||
\xx {}{}{and}{ some other like \%a, b\#, c\$c}{}
|
||||
\xx {}{oh,}{and}{ back\backslash{}slash}{}
|
||||
\xx {}{and some other like \%a,}{b\#,}{ c\$c}{}
|
||||
\xx {}{oh, and}{back\backslash{}slash}{}{}
|
||||
\xx {}{and some other like \%a, b\#,}{c\$c}{}{}
|
||||
\xx {}{let's check special}{characters:}{}{}
|
||||
\xx {}{let's}{check}{ special characters:}{}
|
||||
\xx {}{"quotes",}{for}{ roff}{}
|
||||
\xx {}{$\{$brackets$\}$}{for}{ tex}{}
|
||||
\xx {}{}{hello}{ world!}{}
|
||||
\xx {}{}{let's}{ check special characters:}{}
|
||||
\xx {}{and some other}{like}{ \%a, b\#, c\$c}{}
|
||||
\xx {}{}{maybe}{ also~or^}{}
|
||||
\xx {}{}{oh,}{ and back\backslash{}slash}{}
|
||||
\xx {}{and some}{other}{ like \%a, b\#, c\$c}{}
|
||||
\xx {}{"quotes", for}{roff}{}{}
|
||||
\xx {}{and}{some}{ other like \%a, b\#, c\$c}{}
|
||||
\xx {}{let's check}{special}{ characters:}{}
|
||||
\xx {}{$\{$brackets$\}$ for}{tex}{}{}
|
||||
\xx {}{hello}{world!}{}{}
|
||||
\xx {}{}{$\{$brackets$\}$}{ for tex}{}
|
24
test/ptx.rs
24
test/ptx.rs
|
@ -10,51 +10,49 @@ mod util;
|
|||
#[test]
|
||||
fn gnu_ext_disabled_roff_no_ref() {
|
||||
let opts = vec!["-G", "-R"];
|
||||
test_ptx(&opts);
|
||||
test_ptx(&opts, "gnu_ext_disabled_roff_no_ref.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gnu_ext_disabled_roff_input_ref() {
|
||||
let opts = vec!["-G", "-r", "-R"];
|
||||
test_ptx(&opts);
|
||||
test_ptx(&opts, "gnu_ext_disabled_roff_input_ref.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gnu_ext_disabled_roff_auto_ref() {
|
||||
let opts = vec!["-G", "-A", "-R"];
|
||||
test_ptx(&opts);
|
||||
test_ptx(&opts, "gnu_ext_disabled_roff_auto_ref.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gnu_ext_disabled_tex_no_ref() {
|
||||
let opts = vec!["-G", "-T", "-R"];
|
||||
test_ptx(&opts);
|
||||
test_ptx(&opts, "gnu_ext_disabled_tex_no_ref.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gnu_ext_disabled_tex_input_ref() {
|
||||
let opts = vec!["-G", "-T", "-r", "-R"];
|
||||
test_ptx(&opts);
|
||||
test_ptx(&opts, "gnu_ext_disabled_tex_input_ref.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gnu_ext_disabled_tex_auto_ref() {
|
||||
let opts = vec!["-G", "-T", "-A", "-R"];
|
||||
test_ptx(&opts);
|
||||
test_ptx(&opts, "gnu_ext_disabled_tex_auto_ref.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gnu_ext_disabled_ignore_and_only_file() {
|
||||
let opts = vec!["-G", "-o", "only", "-i", "ignore"];
|
||||
test_ptx(&opts);
|
||||
test_ptx(&opts, "gnu_ext_disabled_ignore_and_only_file.expected");
|
||||
}
|
||||
|
||||
fn test_ptx(opts: &Vec<&str>) {
|
||||
fn test_ptx(opts: &Vec<&str>, expected: &str) {
|
||||
let mut ptx = Command::new(PROGNAME);
|
||||
let result = run(&mut ptx.args(opts).arg("input"));
|
||||
let mut gnu_ptx = Command::new("ptx");
|
||||
let gnu_result = run(&mut gnu_ptx.args(opts).arg("input"));
|
||||
assert_eq!(result.success, true);
|
||||
assert_eq!(result.stdout, gnu_result.stdout);
|
||||
assert!(result.success);
|
||||
assert_eq!(result.stdout, get_file_contents(expected));
|
||||
assert_empty_stderr!(&result);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue