Commit Graph
297 Commits
Author SHA1 Message Date
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