sapling/tests/test-run-tests.t
Matt Mackall 17d82e7fd5 run-tests: replace inline python handling with more native scheme
Normally changes in tests are reported like this in diffs:

   $ cat foo
-  a
+  b

Using -i mode lets us update tests when the new results are correct
and/or populate tests with their output.

But with the standard doctest framework, inline Python sections in
tests changes instead result in a big failure report that's unhelpful.
So here, we replace the doctest calls with a simple compile/eval loop.
2011-11-07 13:46:41 -06:00

59 lines
648 B
Perl

Simple commands:
$ echo foo
foo
$ printf 'oh no'
oh no (no-eol)
$ printf 'bar\nbaz\n' | cat
bar
baz
Multi-line command:
$ foo() {
> echo bar
> }
$ foo
bar
Return codes before inline python:
$ false
[1]
Doctest commands:
>>> print 'foo'
foo
$ echo interleaved
interleaved
>>> for c in 'xyz':
... print c
x
y
z
>>> print
Regular expressions:
$ echo foobarbaz
foobar.* (re)
$ echo barbazquux
.*quux.* (re)
Globs:
$ printf '* \\foobarbaz {10}\n'
\* \\fo?bar* {10} (glob)
Literal match ending in " (re)":
$ echo 'foo (re)'
foo (re)
Exit code:
$ (exit 1)
[1]