Skip to content

Commit

Permalink
tests: (head) cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed Aug 9, 2020
1 parent c1f518e commit b38abbc
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions tests/by-util/test_head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ fn test_verbose() {

#[test]
fn test_spams_newline() {
new_ucmd!()
.pipe_in("a")
.succeeds()
.stdout_is("a\n");
new_ucmd!().pipe_in("a").succeeds().stdout_is("a\n");
}

#[test]
Expand All @@ -102,7 +99,7 @@ fn test_unsupported_byte_syntax() {
.fails()
//GNU head returns "a"
.stdout_is("")
.stderr_is("head: error: Unrecognized option: \'1\'");
.stderr_is("head: error: Unrecognized option: \'1\'");
}

#[test]
Expand All @@ -113,7 +110,7 @@ fn test_unsupported_line_syntax() {
.fails()
//.stdout_is("a\n"); What GNU head returns.
.stdout_is("")
.stderr_is("head: error: invalid line count \'2048m\': invalid digit found in string");
.stderr_is("head: error: invalid line count \'2048m\': invalid digit found in string");
}

#[test]
Expand All @@ -123,7 +120,7 @@ fn test_unsupported_zero_terminated_syntax() {
.pipe_in("x\0y")
.fails()
//GNU Head returns "x\0"
.stderr_is("head: error: Unrecognized option: \'z\'");
.stderr_is("head: error: Unrecognized option: \'z\'");
}

#[test]
Expand All @@ -133,18 +130,17 @@ fn test_unsupported_zero_terminated_syntax_2() {
.pipe_in("x\0y")
.fails()
//GNU Head returns "x\0y"
.stderr_is("head: error: Unrecognized option: \'z\'");
.stderr_is("head: error: Unrecognized option: \'z\'");
}


#[test]
fn test_unsupported_negative_byte_syntax() {
new_ucmd!()
.args(&["--bytes=-2"])
.pipe_in("a\n")
.fails()
//GNU Head returns ""
.stderr_is("head: error: invalid byte count \'-2\': invalid digit found in string");
.stderr_is("head: error: invalid byte count \'-2\': invalid digit found in string");
}

#[test]
Expand All @@ -154,5 +150,5 @@ fn test_bug_in_negative_zero_lines() {
.pipe_in("a\nb\n")
.succeeds()
//GNU Head returns "a\nb\n"
.stdout_is("");
.stdout_is("");
}

0 comments on commit b38abbc

Please sign in to comment.