Show More
@@ -1,85 +1,99 b'' | |||
|
1 | 1 | Simple commands: |
|
2 | 2 | |
|
3 | 3 | $ echo foo |
|
4 | 4 | foo |
|
5 | 5 | $ printf 'oh no' |
|
6 | 6 | oh no (no-eol) |
|
7 | 7 | $ printf 'bar\nbaz\n' | cat |
|
8 | 8 | bar |
|
9 | 9 | baz |
|
10 | 10 | |
|
11 | 11 | Multi-line command: |
|
12 | 12 | |
|
13 | 13 | $ foo() { |
|
14 | 14 | > echo bar |
|
15 | 15 | > } |
|
16 | 16 | $ foo |
|
17 | 17 | bar |
|
18 | 18 | |
|
19 | 19 | Return codes before inline python: |
|
20 | 20 | |
|
21 | 21 | $ sh -c 'exit 1' |
|
22 | 22 | [1] |
|
23 | 23 | |
|
24 | 24 | Doctest commands: |
|
25 | 25 | |
|
26 | 26 | >>> print 'foo' |
|
27 | 27 | foo |
|
28 | 28 | $ echo interleaved |
|
29 | 29 | interleaved |
|
30 | 30 | >>> for c in 'xyz': |
|
31 | 31 | ... print c |
|
32 | 32 | x |
|
33 | 33 | y |
|
34 | 34 | z |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | |
|
38 | 38 | Regular expressions: |
|
39 | 39 | |
|
40 | 40 | $ echo foobarbaz |
|
41 | 41 | foobar.* (re) |
|
42 | 42 | $ echo barbazquux |
|
43 | 43 | .*quux.* (re) |
|
44 | 44 | |
|
45 | 45 | Globs: |
|
46 | 46 | |
|
47 | 47 | $ printf '* \\foobarbaz {10}\n' |
|
48 | 48 | \* \\fo?bar* {10} (glob) |
|
49 | 49 | |
|
50 | 50 | Literal match ending in " (re)": |
|
51 | 51 | |
|
52 | 52 | $ echo 'foo (re)' |
|
53 | 53 | foo (re) |
|
54 | 54 | |
|
55 | 55 | testing hghave |
|
56 | 56 | |
|
57 | 57 | $ "$TESTDIR/hghave" true |
|
58 | 58 | $ "$TESTDIR/hghave" false |
|
59 | 59 | skipped: missing feature: nail clipper |
|
60 | 60 | [1] |
|
61 | 61 | $ "$TESTDIR/hghave" no-true |
|
62 | 62 | skipped: system supports yak shaving |
|
63 | 63 | [1] |
|
64 | 64 | $ "$TESTDIR/hghave" no-false |
|
65 | 65 | |
|
66 | 66 | Conditional sections based on hghave: |
|
67 | 67 | |
|
68 | 68 | #if true |
|
69 | 69 | $ echo tested |
|
70 | 70 | tested |
|
71 | 71 | #else |
|
72 | 72 | $ echo skipped |
|
73 | 73 | #endif |
|
74 | 74 | |
|
75 | 75 | #if false |
|
76 | 76 | $ echo skipped |
|
77 | 77 | #else |
|
78 | 78 | $ echo tested |
|
79 | 79 | tested |
|
80 | 80 | #endif |
|
81 | 81 | |
|
82 | #if no-false | |
|
83 | $ echo tested | |
|
84 | tested | |
|
85 | #else | |
|
86 | $ echo skipped | |
|
87 | #endif | |
|
88 | ||
|
89 | #if no-true | |
|
90 | $ echo skipped | |
|
91 | #else | |
|
92 | $ echo tested | |
|
93 | tested | |
|
94 | #endif | |
|
95 | ||
|
82 | 96 | Exit code: |
|
83 | 97 | |
|
84 | 98 | $ (exit 1) |
|
85 | 99 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now