Commit graph

231 commits

Author SHA1 Message Date
Joseph Crail
cf399faad2 Add initial tests for default values 2015-12-12 16:24:48 -05:00
Joseph Crail
d6039c1b22 Remove build for unit tests.
Currently no utility has unit tests, only integration tests.
2015-12-06 22:49:56 -05:00
Joseph Crail
2c8ebb6215 Mark chmod as Unix-only until better Win support. 2015-12-01 01:33:38 -05:00
Michael Gehring
2f4ae615ed comm: add basic tests 2015-11-28 20:51:11 +01:00
Joseph Crail
d4e0ea41a3 Fix namespace collision for test.
To avoid linking issues with Rust's libtest, the crate for the test
utility was changed to 'uutest'. However, the user doesn't need to see
this so a few hoops were jumped through to make this transparent.

I also updated the make rules to build the individual features first and
then uutils. This makes 'make && make test' look more organized.
2015-11-27 01:54:18 -05:00
Joseph Crail
7ef6bdbe81 Compile only against needed dependencies. 2015-11-26 17:51:31 -05:00
Joseph Crail
927049548c Clean up whitespace and remove unused aliases. 2015-11-26 17:13:41 -05:00
Joseph Crail
340ad317e1 Remove syntax error from build. 2015-11-26 17:02:55 -05:00
Joseph Crail
2d41e6641c Set build/test make rules to be fail fast. 2015-11-25 17:33:07 -05:00
Joseph Crail
089d15c4ca Remove non-fail-fast build and test rules. 2015-11-25 17:32:02 -05:00
Joseph Crail
412025b45a Fix whitespace and sort order of tests. 2015-11-25 04:05:12 -05:00
Joseph Crail
c0c8d3ecec Fix test scaffolding after Cargo updates. 2015-11-25 01:50:57 -05:00
Nathan Ross
502957dc3e use cargo idioms to manage dependency resolution and compilation 2015-11-23 02:04:15 -05:00
Nathan Ross
a21c54e2cd rewrite tests for cargo compat, decoupled directory, output handling 2015-11-23 02:04:15 -05:00
Joseph Crail
10a2c5c224 Add tests for link. 2015-11-02 01:13:34 -05:00
Joseph Crail
3b5c776675 Add tests for rmdir.
I also adjusted error message to conform to GNU implementation.
2015-11-01 15:31:48 -05:00
Roman Gafiyatullin
092e4d1ed4 Implement expr.
Implemented as follows:

    Usage: expr EXPRESSION
      or:  expr OPTION

          --help     display this help and exit
          --version  output version information and exit

    Print the value of EXPRESSION to standard output.  A blank line below
    separates increasing precedence groups.  EXPRESSION may be:

      ARG1 | ARG2       ARG1 if it is neither null nor 0, otherwise ARG2

      ARG1 & ARG2       ARG1 if neither argument is null or 0, otherwise 0

      ARG1 < ARG2       ARG1 is less than ARG2
      ARG1 <= ARG2      ARG1 is less than or equal to ARG2
      ARG1 = ARG2       ARG1 is equal to ARG2
      ARG1 != ARG2      ARG1 is unequal to ARG2
      ARG1 >= ARG2      ARG1 is greater than or equal to ARG2
      ARG1 > ARG2       ARG1 is greater than ARG2

      ARG1 + ARG2       arithmetic sum of ARG1 and ARG2
      ARG1 - ARG2       arithmetic difference of ARG1 and ARG2

      ARG1 * ARG2       arithmetic product of ARG1 and ARG2
      ARG1 / ARG2       arithmetic quotient of ARG1 divided by ARG2
      ARG1 % ARG2       arithmetic remainder of ARG1 divided by ARG2

      STRING : REGEXP   [NOT IMPLEMENTED] anchored pattern match of REGEXP in STRING

      match STRING REGEXP        [NOT IMPLEMENTED] same as STRING : REGEXP
      substr STRING POS LENGTH   [NOT IMPLEMENTED] substring of STRING, POS counted from 1
      index STRING CHARS         [NOT IMPLEMENTED] index in STRING where any CHARS is found, or 0
      length STRING              [NOT IMPLEMENTED] length of STRING
      + TOKEN                    interpret TOKEN as a string, even if it is a
                                   keyword like 'match' or an operator like '/'

      ( EXPRESSION )             value of EXPRESSION

    Beware that many operators need to be escaped or quoted for shells.
    Comparisons are arithmetic if both ARGs are numbers, else lexicographical.
    Pattern matches return the string matched between \( and \) or null; if
    \( and \) are not used, they return the number of characters matched or 0.

    Exit status is 0 if EXPRESSION is neither null nor 0, 1 if EXPRESSION is null
    or 0, 2 if EXPRESSION is syntactically invalid, and 3 if an error occurred.

    Environment variables:
    	* EXPR_DEBUG_TOKENS=1   dump expression's tokens
    	* EXPR_DEBUG_RPN=1      dump expression represented in reverse polish notation
    	* EXPR_DEBUG_SYA_STEP=1 dump each parser step
    	* EXPR_DEBUG_AST=1      dump expression represented abstract syntax tree
2015-10-09 12:31:25 +03:00
Carlos Liam
87d14978e9 Clean whitespace
Remove leading newlines and replace lines containing only whitespace
with empty lines
2015-10-06 12:04:46 -04:00
Gustavo Hexsel
f8df842dfb Moved code officially to run on nightly since it's a dependency 2015-08-26 12:50:07 -04:00
Joseph Crail
04014d314c Add tests for cksum/sum. 2015-08-13 21:08:31 -07:00
Joseph Crail
cc4cf6049e Add tests for touch. 2015-08-11 21:45:11 -04:00
Joseph Crail
929474040b Add tests for cut. 2015-07-31 00:14:58 -04:00
Peter Atashian
47f82f0de2 Various Windows fixes
Improve handling of unicode on Windows
Disable a few crates on Windows that abuse unix APIs too much

Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-07-19 20:25:48 -04:00
Joseph Crail
6ef7f98f26 Delay resolution of library symbols until runtime.
This is needed for dynamic libraries on OS X. This was supposed to be
part of #647, but it was left out.
2015-07-09 18:39:46 -04:00
Alex Lyon
8f6d13df5f Merge pull request #647 from jbcrail/fix-osx-stdbuf
Fix OS X build errors for stdbuf.
2015-07-09 14:58:07 -07:00
Joseph Crail
b8ab2c125f Fix stdbuf regression.
When replacing range_inclusive(), I introduced a bug when parsing
arguments. I added a smoke test to prevent basic regressions in the
future.
2015-07-09 15:23:14 -04:00
Joseph Crail
3fa2e89a7a Fix OS X build errors for stdbuf.
I removed unused linker flags, added platform-specific linker flags, and
used DYLD_LIBRARY_PATH (instead of DYLD_INSERT_LIBRARIES) for loading
the dynamic library. I also removed an unused variable mutation.
2015-07-09 13:04:04 -04:00
Joseph Crail
9f1dc98925 Add initial implementation for ln.
There are several areas needing improvement:

1) add tests for hard links
2) add implementation for uncommon flags (-d, -L, -n, -P, -r)
3) align error messages more closely with GNU implementation
2015-07-05 14:52:31 -04:00
Joseph Crail
dcfc23498e Add tests for tac. 2015-06-06 22:33:56 -04:00
Joseph Crail
23cb9541e7 Add initial tests for realpath. 2015-06-04 00:04:37 -04:00
Joseph Crail
2dd90af92a Add initial tests. 2015-06-03 01:41:56 -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
dokaptur
ea7df03c0a initial ptx commit 2015-05-30 09:35:28 +02:00
Joseph Crail
2bde7872c5 Add tests for base64. 2015-05-28 23:25:13 -04:00
Joseph Crail
b4b08de42c Switch to external getopts cargo (part 1).
I switched over to the getopts crate on crates.io, instead of Rust's
private implementation. This will allow coreutils to build for Rust 1.0.

I'm splitting the updates into several commits for better reviewing.
2015-05-20 22:47:30 -04: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
Joseph Crail
481fdd744a Add tests for readlink. 2015-05-12 17:09:41 -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