Giter Site home page Giter Site logo

acbtest's Introduction

Semi-lightweight test and grep wrappers

Wrappers for test and grep which will output the args when they fail.

The wrappers use bash (sorry sh is not supported due to quote escapping for {$var@Q}.

acbtest

Wraps the test command, and outputs the command to stderr if it fails, e.g.

$ ./acbtest "abc" = "acb"
test 'abc' '=' 'acb' failed

acbdiff

Wraps the diff command, and outputs the command to stderr if it fails, e.g.

$ ./acbdiff <(echo hello) <(echo Hello)
1c1
< hello
---
> Hello
diff '/dev/fd/63' '/dev/fd/62' failed

acbgrep

Wraps the grep command, and outputs the command to stderr if it fails; additionally if reading from a pipe, it will also display the contents of the pipe.

$ ./acbgrep o some-file 
hello
world

$ cat some-file | ./acbgrep o
hello
world

$ ./acbgrep bye some-file 
grep 'bye' 'some-file' failed

# special case where stdin is printed on failure
$ cat some-file | ./acbgrep bye
hello
world
grep 'bye' failed

# disable echoing stdin with
$ cat some-file | ACBGREP_NO_ECHO=1 ./acbgrep bye
grep 'bye' failed

License

acbtest (and acbgrep) is free and unencumbered software released into the public domain; see Unlicense for details.

acbtest's People

Contributors

alexcb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.