Commit graph

12 commits

Author SHA1 Message Date
Joseph Crail
7ef4bb37a8 tests: consolidate into one crate
The main motivation is to move toward running those tests for a specific
target, that is, if a test won't run on Windows, then we shouldn't build
it. This was previously the default behavior and prevented a successful
run on AppVeyor.

I borrowed this pattern from the tests in the Cargo project.
2016-05-22 03:46:54 -04:00
Valentin Lorentz
e673a102b6 tail: Add test for tail -f. 2016-04-03 11:47:33 +02:00
Nick Fitzgerald
3972c6eb53 tail: Clean up and test suffix multiplier
Makes `parse_size` return a `Result` where the `Err` part indicates whether
there was a parsing error, or the parse size is too big to store. Also makes the
value parsed a `u64` rather than a `usize`.

Adds unit tests for `parse_size` and integration tests using the suffix
multiplier in a number passed with the `-n` flag.
2016-04-02 14:16:11 -07:00
Valentin Lorentz
2fd7164cda tail: Implement tail -z.
This options makes tail use NULL instead of newline as a line
delimiter.
2016-04-02 12:32:33 +02:00
Nick Fitzgerald
0d281cf886 tests/tail: Test when -n is larger than the number of lines in the file 2016-03-27 14:42:45 -07:00
Nick Fitzgerald
9a5209a7a4 tests/tail: Rename INPUT to FOOBAR_TXT as there are more than one inputs 2016-03-27 14:41:56 -07:00
Nick Fitzgerald
0bc05e2dcf tests/tail: Add a test for tail'ing large files in bytes mode 2016-03-27 14:34:59 -07:00
Nick Fitzgerald
1be7d31d5a tests/tail: Refactor the test_single_big_args test to use ScopedFile 2016-03-27 14:34:59 -07:00
Nick Fitzgerald
9824bc4db3 Add a test for tail -c <BYTES> from stdin 2016-03-26 11:56:00 -07:00
Nick Fitzgerald
445233389e Add a test for tail -c <BYTES> <FILE> 2016-03-26 11:52:10 -07:00
Nick Fitzgerald
d7974c56a0 tests/tail: Add a test for tail'ing large files
This tests both large files and iterating backwards through the file when we
need to search backwards further than our BUFFER_SIZE.
2016-03-21 07:51:48 -07:00
Joseph Crail
cf399faad2 Add initial tests for default values 2015-12-12 16:24:48 -05:00