Commit graph

53 commits

Author SHA1 Message Date
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
Michael Gehring
906d3e4ec5 write -> write_all 2015-01-29 08:47:43 +01:00
Michael Gehring
d187dc574b std::io -> std::old_io 2015-01-29 08:45:37 +01:00
Michael Gehring
58bd009a9e Remove unused imports 2015-01-10 20:44:57 +01:00
Michael Gehring
4d6cbfa393 Disable unstable warnings for now 2015-01-10 20:44:56 +01:00
Michael Gehring
fd2536fc57 mv, sort, truncate: fix test build 2015-01-10 20:40:38 +01:00
Michael Gehring
1b381f49fa Use new macro feature flags/attributes 2015-01-08 14:50:02 +01:00
Santiago Lapresta
8644b75a85 Fix deprecation warnings (into_string => to_owned) 2014-12-25 19:33:09 +01:00
Haitao Li
9b67c372b2 Add semicolons to item macros 2014-12-22 10:54:29 +11:00
Michael Gehring
52ea352ca3 test/{seq,tr,truncate,unexpand}: fix build 2014-11-20 20:46:45 +01:00
Alex Lyon
03f26845d7 Merge pull request #432 from awestroke/more_mv_test_cases
More mv tests and use cases
2014-10-31 01:30:54 -07:00
Michael Gehring
3244416b19 fail! -> panic! 2014-10-30 10:06:47 +01:00
Orvar Segerström
019abb993e More mv tests and use cases 2014-10-30 08:47:26 +01:00
Orvar Segerström
beba02757e MV implementation
Support for all commandline options except one, see src/mv/mv.rs

Many tests, included a todo list of more tests too, see tests/mv.rs
2014-10-26 11:27:28 +01:00
Arcterus
ccc6772646 test: add some tests for -a and -o 2014-10-20 22:04:17 -07:00
Alex Lyon
ea5d67f8dc Merge pull request #420 from skv-headless/move_util
move utility
2014-10-19 11:50:15 -07:00
skv
9f20647984 move_util 2014-10-19 22:41:11 +04:00
Michael Yin
bde6d8d643 basic byte and numeric sort
tests for numeric sort
2014-10-18 18:33:18 -04:00
Jay Shah
eb2415fb90 Introduce a test for `cp'. 2014-10-14 08:13:18 +01:00
Arcterus
8df93584c8 Remove warnings from the mkdir tests 2014-10-06 21:34:54 -07:00
Arcterus
01c2a0b9ff Remove all warnings (at least on Linux) 2014-09-16 20:08:40 -07:00
Arcterus
01c681ecb3 Update for latest Rust 2014-09-16 19:10:27 -07:00
Virgile Andreani
49a733a864 Implement unexpand 2014-07-28 19:36:33 +02:00
Arcterus
439a8cadd1 Move tests out of src and into test 2014-07-21 14:44:30 -07:00