This grabs code from GNU ease.js.
* .gitignore (build-aux/): Ignore all but `vergen'.
* build-aux/vergen: Add file copied from GNU ease.js.
* configure.ac: Use it.
The Google coding standard that used `::' was cute and all, but without a
broader framework to surround it (which I do not have time for atm), it's
too much. `:' seems just as reasonable as a namespace delimiter.
* src/spec.sh
(__spec_result): Remove variable.
(__spec_outfile): Add variable.
(expect): Write stdout to temporary file rather than storing in variable,
which strips trailing whitespace and does not handle null bytes.
(shspec::__handle-to): Use `$__spec_outpath'.
Update copyright years.
* test/test-spec: Add tests for trailing whitespace and binary comparison.
This is motivated by Google's shell coding standards and will reduce the
odds of a naming conflict with other functions (which, of course, would
cause terribly odd and difficult-to-find bugs, in both our system and
others').
If this seems like it creates long, overly-verbose function names with no
relief in sight---you're right. I'll have a solution for that in a bit, as a
separate project. ...as a part of my never-ending, growing heap of projects.
The name is not intended to sound cute: it means "array okay".
Note that this also demonstrates the need for a silent check: `aok foo' will
fail, but will output an error.
It should not, by convention, be used by any test cases; its opening here
will (presumably, at least) prevent the shell from automatically allocating
it for any file operations and subshells.
This is unfortunately one of the cleanest ways to implement this, since
stdout is piped to stdin of the handler; I did not want to rely on using a
file descriptor, because then you have to deal with issues of rewinding the
pointer for possible future uses, and other considerations.
Added license information and boilerplate for build process; no
documentation yet (aside from test cases); it will be added after a bit more
development in standard Texinfo format.
This allows the implementation to vary in the number of arguments provided
to the expectation handlers without breaking BC so long as the meanings of
the shifted arguments do not change.