Show More
@@ -1,121 +1,121 | |||
|
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 | Windows: \r\n is handled like \n and can be escaped: |
|
56 | 56 | |
|
57 | 57 | #if windows |
|
58 | 58 | $ printf 'crlf\r\ncr\r\tcrlf\r\ncrlf\r\n' |
|
59 | 59 | crlf |
|
60 | 60 | cr\r (no-eol) (esc) |
|
61 | 61 | \tcrlf (esc) |
|
62 | 62 | crlf\r (esc) |
|
63 | 63 | #endif |
|
64 | 64 | |
|
65 | 65 | Combining esc with other markups - and handling lines ending with \r instead of \n: |
|
66 | 66 | |
|
67 | 67 | $ printf 'foo/bar\r' |
|
68 |
fo |
|
|
68 | fo?/bar\r (no-eol) (glob) (esc) | |
|
69 | 69 | #if windows |
|
70 | 70 |
$ |
|
71 | 71 | foo/bar\r (no-eol) (glob) (esc) |
|
72 | 72 | #endif |
|
73 | 73 | $ printf 'foo/bar\rfoo/bar\r' |
|
74 | 74 | foo.bar\r \(no-eol\) (re) (esc) |
|
75 | 75 | foo.bar\r \(no-eol\) (re) |
|
76 | 76 | |
|
77 | 77 | testing hghave |
|
78 | 78 | |
|
79 | 79 | $ "$TESTDIR/hghave" true |
|
80 | 80 | $ "$TESTDIR/hghave" false |
|
81 | 81 | skipped: missing feature: nail clipper |
|
82 | 82 | [1] |
|
83 | 83 | $ "$TESTDIR/hghave" no-true |
|
84 | 84 | skipped: system supports yak shaving |
|
85 | 85 | [1] |
|
86 | 86 | $ "$TESTDIR/hghave" no-false |
|
87 | 87 | |
|
88 | 88 | Conditional sections based on hghave: |
|
89 | 89 | |
|
90 | 90 | #if true |
|
91 | 91 | $ echo tested |
|
92 | 92 | tested |
|
93 | 93 | #else |
|
94 | 94 | $ echo skipped |
|
95 | 95 | #endif |
|
96 | 96 | |
|
97 | 97 | #if false |
|
98 | 98 | $ echo skipped |
|
99 | 99 | #else |
|
100 | 100 | $ echo tested |
|
101 | 101 | tested |
|
102 | 102 | #endif |
|
103 | 103 | |
|
104 | 104 | #if no-false |
|
105 | 105 | $ echo tested |
|
106 | 106 | tested |
|
107 | 107 | #else |
|
108 | 108 | $ echo skipped |
|
109 | 109 | #endif |
|
110 | 110 | |
|
111 | 111 | #if no-true |
|
112 | 112 | $ echo skipped |
|
113 | 113 | #else |
|
114 | 114 | $ echo tested |
|
115 | 115 | tested |
|
116 | 116 | #endif |
|
117 | 117 | |
|
118 | 118 | Exit code: |
|
119 | 119 | |
|
120 | 120 | $ (exit 1) |
|
121 | 121 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now