coreutils/tests/test_ptx.rs
Nathan Ross 569cd162d3 tests: refactor conventional TestScenario usage
Updates to individual integration tests

  - use proposed conventional approach to beginning tests

  - use new convenience functions for using fixtures

  - use new names for TestScenario

Updates to integration test modules

  - add proposed conventional module-level functions

Updates to test/common/util.rs

  - rename TestSet, and its methods, for semantic clarity

  - create convenience functions for use of fixtures

  - delete convenience functions obsoleted by new conventions
2016-08-01 13:42:00 -04:00

52 lines
1.3 KiB
Rust

use common::util::*;
static UTIL_NAME: &'static str = "ptx";
fn new_ucmd() -> UCommand {
TestScenario::new(UTIL_NAME).ucmd()
}
#[test]
fn gnu_ext_disabled_roff_no_ref() {
let opts = vec!["-G", "-R"];
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, "gnu_ext_disabled_roff_input_ref.expected");
}
#[test]
fn gnu_ext_disabled_roff_auto_ref() {
let opts = vec!["-G", "-A", "-R"];
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, "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, "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, "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, "gnu_ext_disabled_ignore_and_only_file.expected");
}
fn test_ptx(opts: &Vec<&str>, expected: &str) {
new_ucmd().args(opts).arg("input").succeeds().stdout_only_fixture(expected);
}