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