Commit graph

70 commits

Author SHA1 Message Date
Valentin Lorentz
8ff308740c Fix test on Rust Stable.
https://github.com/rust-lang/rust/issues/32801
2016-04-07 20:54:22 +02:00
Valentin Lorentz
e673a102b6 tail: Add test for tail -f. 2016-04-03 11:47:33 +02:00
Valentin Lorentz
4ba6ea7aad tests: Move part of UCommand::run to a new function 2016-04-03 11:46:33 +02:00
Valentin Lorentz
fe5bc47971 tests: Simplify logic of UCommand::run. 2016-04-03 11:46: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
Joseph Crail
fb0e6a9dee tests/sort: simplify input to helper 2016-03-29 00:58:24 -04:00
Joseph Crail
6b129887d6 tests/sort: add test for default mode 2016-03-29 00:58:24 -04:00
Joseph Crail
b290c10845 tests/sort: refactor to match other tests
Instead of using numerals to denote individual cases, I used descriptive
case names. I also changed the extension for the expected output fixture
to match other tests.

I removed one redundant test and another unnecessary helper function.
2016-03-29 00:58:24 -04:00
Joseph Crail
91df9b14da tests: remove unused method 2016-03-28 23:25:50 -04:00
Joseph Crail
7d103a0a64 tests: fix whitespace 2016-03-28 23:25:26 -04:00
Joseph Crail
1fecba3226 tests/{readlink, realpath}: fix tests on Windows
I fixed the tests that assumed paths used a Unix directory separator.
2016-03-28 23:24:40 -04:00
Heather
c954b01aa3 Merge pull request #854 from fitzgen/tests-for-tail-bytes
Miscellaneous `tail` related commits
2016-03-28 09:05:48 +04: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
a629bb3076 tests: Create the ScopedFile type for temporary files in tests
This commit adds the `ScopedFile` type, which wraps and derefs to a `File`. When
a `ScopedFile` is dropped, it removes the underlying file from the
filesystem. This is useful for temporary, generated files in tests.
2016-03-27 14:34:59 -07:00
Joseph Crail
ec14be84aa tests/pwd: fix broken Windows test
Due to canonicalize()'s use of GetFinalPathNameByHandleW() on Windows,
the resolved path starts with '\\?\' to extend the limit of a given path
to 32,767 wide characters.

To address this issue, we remove this prepended string if available.
2016-03-27 03:28:55 -04: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
Joseph Crail
faedb2dd2e tests/sort: fix flag for human numeric test 2016-03-25 16:55:58 -04:00
Joseph Crail
55c0b1786f tests/sort: add tests for month sort 2016-03-25 16:55:58 -04: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
Nick Fitzgerald
161f96dc8c tests/tail: Rename tail test fixture contents to be easier to read
The repetition of "foo" and "bar" made for difficult-to-read assertion failures
when hacking on `tail`. I think that having each line have unique contents makes
it a bit easier to parse.
2016-03-21 07:51:42 -07:00
Luca Ottaviano
5dc0a55630 chmod: fix reference option
Reference option must have a file path.
Fix C interface using CString.
Better error message if the file doesn't exist.
2016-03-10 20:34:49 +01:00
Chirag B. Jadwani
676e3718c3 uniq: add tests 2016-02-29 11:07:16 +05:30
Nathan Ross
d1e785c1dc comm: additional tests and status/stderr checking for existing tests 2016-02-22 09:59:06 -05:00
Heather
267a7d043a Merge pull request #821 from ebfe/cat-test
tests/cat: --squeeze-blank test
2016-02-22 09:24:32 +04:00
Nathan Ross
5e764ecf6e more ergonomic testing 2016-02-18 13:24:36 -05:00
Michael Gehring
c0d91d225f tests/cat: --squeeze-blank test 2016-02-17 08:06:32 +01:00
Nathan Ross
e44f29a020 basename: tests for bad inputs 2016-02-16 16:47:09 -05:00
Nathan Ross
8190c30a85 basename: tests for remaining options 2016-02-16 16:47:09 -05:00
Nathan Ross
21cee1556b basename: in tests, assert error-free in usage 2016-02-16 16:47:09 -05:00
Nathan Ross
962fcd7183 base64: tests for incorrect wrap args 2016-02-16 16:47:09 -05:00
Nathan Ross
2bad30b2b0 base64: in tests, test both option forms 2016-02-16 02:20:09 -05:00
Nathan Ross
e32efaa5a1 allow feature-gated integration tests for unimplemented functionality 2016-02-15 23:48:37 -05:00
Nathan Ross
5f88dfe12b printf: rustfmt pass 2016-02-15 00:48:08 -05:00
Nathan Ross
0892ad3cde printf: add (spare C99 hex floats) 2016-02-15 00:10:30 -05:00
Michael Gehring
1760f2937b Merge pull request #814 from shalupov/mark-fixtures-data-as-binary
.gitattributes: treat tests/fixtures/** as binary data
2016-02-14 19:21:18 +01:00
Leonid Shalupov
1b48438b44 .gitattributes: treat tests/fixtures/** as binary data to prevent CRLF convertion by git under Windows 2016-02-14 17:09:47 +01:00
Leonid Shalupov
1ae82193f0 tests: do not remove %SYSTEMROOT% from environment variables, it's required to initialize crypto provider (which is required for std::rand) 2016-02-14 16:34:39 +01:00
Michael Gehring
162e21a418 tests/mktemp: fix build on nightly 2016-02-14 03:31:10 +01:00
Michael Gehring
033dd3a0ae tests/chmod: fix tests on nightly 2016-01-23 05:06:02 +01:00
Arcterus
49d0815588 tests: fix tests that broke when using a symlinked /tmp 2016-01-10 02:50:39 -08:00
Arcterus
d9ad0b185a tests: fix tests that were failing on OS X 2016-01-10 00:09:05 -08:00
Arcterus
ee669ab55b chmod: rewrite mode parser 2016-01-04 20:00:34 -08:00
Michael Gehring
1a78be7e37 tests/mktemp: remove unused import 2016-01-04 18:43:03 +01:00
Michael Gehring
73cd23ca71 Merge pull request #781 from KeenS/mktemp
Mktemp
2016-01-04 18:40:08 +01:00
Michael Gehring
2bc3001a3a tests/chmod: disable failing tests
See #788
2016-01-04 17:58:15 +01:00