Commit graph

76 commits

Author SHA1 Message Date
Joseph Crail
9bc33a43f9 Fix ptx tests on OS X.
For those systems that don't have ptx installed by default, I modified
the tests to use pre-calculated results to check against the GNU
implementation.
2015-06-05 19:55:02 -04:00
Joseph Crail
0df4918f2d Fix split tests.
I added an additional regex dependency and converted strings to
Vec<u8>'s for the assertions.
2015-06-04 13:57:17 -04:00
Joseph Crail
23cb9541e7 Add initial tests for realpath. 2015-06-04 00:04:37 -04:00
Joseph Crail
4aed2eafa8 Move common methods into test library. 2015-06-04 00:04:10 -04:00
Joseph Crail
c3802bb69c Add helper method for creating symlinks. 2015-06-04 00:03:25 -04:00
Joseph Crail
2dd90af92a Add initial tests. 2015-06-03 01:41:56 -04:00
Joseph Crail
b25a344566 Add quiet and verbose flags to head. 2015-05-31 20:26:57 -04:00
Heather
6fa4cf8e74 Merge pull request #630 from jbcrail/refactor-test-method
Refactor method to auto-convert into byte array.
2015-05-31 08:46:47 +03:00
Joseph Crail
66e109f683 Fix broken tests. 2015-05-30 20:53:07 -04:00
Joseph Crail
62b9dc0326 Refactor method to auto-convert into byte array.
When creating tests, we could pass a String, &str, or [u8] to the
standard input. Previously, all arguments had to be manually converted
to a reference to a [u8]. This update makes it more ergonomic.
2015-05-30 19:12:49 -04:00
Joseph Crail
133a6c5563 Add initial tests for head. 2015-05-30 19:10:15 -04:00
dokaptur
5aa68eb716 printing version unified and tests 2015-05-30 13:48:53 +02:00
Joseph Crail
edb3295303 Move helper methods for tests to separate module. 2015-05-29 13:47:00 -04:00
Joseph Crail
2bde7872c5 Add tests for base64. 2015-05-28 23:25:13 -04:00
Nikita Ofitserov
c32e21fc01 Add a test for the 'env -' case 2015-05-27 00:49:50 +03:00
Joseph Crail
9d74bbe532 Add initial tests for hashsum. 2015-05-16 18:03:09 -04:00
Heather
3cc357e118 Merge pull request #601 from kwantam/master
improved Sieve implementation ; add `cargo update`
2015-05-16 08:25:23 +03:00
Joseph Crail
906ba3e24a Add tests for unlink. 2015-05-15 20:11:54 -04:00
kwantam
e1dac4695e improved Sieve implementation ; add cargo update
This commit adds `cargo update` to the distclean target in the
makefile. This updates the Cargo.lock file when clearing the
deps directory.

In addition, it adds a faster implementation of the Sieve of
Eratosthenes for use by `src/factor/gen_table.rs` and `test/factor.rs`.
2015-05-15 19:39:43 -04:00
Joseph Crail
497c04ad44 Add tests for rm. 2015-05-15 19:14:42 -04:00
Heather
f0e5c19ed4 Merge pull request #597 from jbcrail/update-mkdir
Update mkdir.
2015-05-14 07:16:11 +03:00
Joseph Crail
18da32f394 Fix mv. 2015-05-13 21:05:36 -04:00
Joseph Crail
7f3d4ebf5b Update mkdir.
In addition to upgrading to the nightly build, I refactored the method
that creates the directories by switching from a recursive approach to
an iterative one. I also replaced the obsolete fs::mkdir() with a custom
method using fs::create_dir() and libc::chmod(). I added several
diagnostic messages that match the GNU implementation.
2015-05-13 16:38:11 -04:00
Joseph Crail
481fdd744a Add tests for readlink. 2015-05-12 17:09:41 -04:00
Joseph Crail
28c21902c5 Fix nl.
Aside from the usual upgrades to sync with the nightly build, I fixed an
unwrap() panic when reading lines with only a newline. I also refactored
the repeated command calls to use helper functions.
2015-05-10 18:59:37 -04:00
Joseph Crail
82dbd02c03 Add initial test for tsort. 2015-05-09 23:38:48 -04:00
Heather
1f67aaaf8c Merge pull request #585 from jbcrail/add-basename-split-tests
Add initial tests for basename/split.
2015-05-09 22:20:23 +03:00
Joseph Crail
08aea6d549 Add initial test for pwd. 2015-05-09 15:17:26 -04:00
Joseph Crail
9172bb9bd8 Add initial tests for false/true. 2015-05-09 15:17:16 -04:00
Joseph Crail
87e7cc9b44 Add initial tests for echo. 2015-05-09 15:17:01 -04:00
Joseph Crail
e700e0d2f4 Add initial tests for dirname. 2015-05-09 15:16:45 -04:00
Joseph Crail
646285f684 Add initial tests for basename. 2015-05-09 13:32:47 -04:00
Joseph Crail
234c81311f Add initial tests for split.
I created random data to test several cases. I verified that the data is
split into the correct number of files and can also be reassembled into
the original file.
2015-05-09 13:32:30 -04:00
Joseph Crail
5878d9904e Add tests for fold. 2015-05-08 00:58:43 -04:00
Heather
b4c106b004 Merge pull request #578 from jbcrail/fix-broken-seq-tests
Fix broken seq tests.
2015-05-08 07:47:25 +03:00
kwantam
ff24d48e73 modify factor impl to eliminate overflow issue
This change does the following:

1. Updates the arithmetic functions in `src/factor/numeric.rs` to
   correctly handle all cases up to 2^64. When numbers are larger
   than 2^63, we fall back to slightly slower routines that check
   for and handle overflow.

2. Since the arithmetic functions will now not overflow, we no longer
   need the safety net trial division implementation. We now always
   use Pollard's rho after eliminating small (<=13 bit) primes.

3. Slight tweak in `src/factor/gen_table.rs` to generate the first
   1027 primes, which means we test every prime of 13 or fewer bits
   before going into Pollard's rho. Includes corresponding update in
   `src/factor/prime_table.rs` and the Makefile to reflect this.

4. Add a new test that generates random numbers with exclusively
   large (14 to 50 bit) prime factors. This exercises the possible
   overflow paths.

5. Add another new test that checks the `is_prime()` function against
   a few dozen 64-bit primes. Again this is to exercise possible
   overflow paths.
2015-05-08 00:06:35 -04:00
kwantam
9a806346a9 add test for factor
Add a test for `factor`.

This commit also pulls factor's Sieve implementation into its own module
so that the factor test can use it.

Finally, slight refactoring for clarity in gen_table.rs.
2015-05-07 18:13:39 -04:00
kwantam
cab4f8d570 fix test 2015-05-07 18:12:32 -04:00
kwantam
cee1837879 slight clarification / refactoring in unexpand
This keeps equivalent functionality but makes the code slightly cleaner.
Also added one more test case.
2015-05-07 18:12:32 -04:00
Joseph Crail
b8fb64a35a Fix broken seq tests. 2015-05-07 17:09:57 -04:00
Joseph Crail
0ea0e7504a Add test for paste. 2015-05-07 16:51:55 -04:00
Joseph Crail
500bbbfa83 Fix env and add tests.
I updated env to use the nightly build. I also added several tests.
2015-05-06 23:59:58 -04:00
Heather
5ec1c7bea4 Merge pull request #570 from jbcrail/fix-sort-test
Fix failing test for sort.
2015-05-07 00:19:53 +03:00
Joseph Crail
8140208cd0 Check return value of read(). 2015-05-06 13:37:57 -04:00
Joseph Crail
c31ad75226 Fix cp.
I used the new File/Path libraries. The canonicalize method made much of
paths_refer_to_same_file() redundant.
2015-05-05 19:42:38 -04:00
Joseph Crail
b809af601a Fix failing test for sort.
The sorted values were not outputted using a newline.
2015-05-05 19:39:30 -04:00
Joseph Crail
5ec7f28625 Fix truncate and related tests. 2015-04-29 19:23:50 -04:00
kwantam
91827a594a fix tr and its test
In addition, this commit substantially reduces the number
of allocations that tr does when building the substitution
tables.
2015-04-29 01:31:16 -04:00
kwantam
feee266b20 fix/rewrite unexpand and its tests
This is a reworked version of unexpand. I did this for two main
reasons:

1. The previous version of unexpand had issues correctly computing
   tabstops when the `-a` flag was supplied.

2. The previous version assumed the input was UTF-8. This version works
   with non-UTF-8 inputs.

3. This version has a new flag, -U, which forces unexpand to
   treat input as 8-bit ASCII rather than interpreting it
   as UTF-8. This might be handy in some cases.
2015-04-29 01:09:27 -04:00
kwantam
cc48e83e98 update cat, cat tests to new API
This commit updates the `cat` utility as well as its testbench
to work with the latest APIs.
2015-04-25 03:28:06 -04:00