|
1 | 1 | shared_examples 'special characters' do
|
2 |
| - describe 'a special character in the buffer' do |
3 |
| - it 'should be treated like any other character' do |
| 2 | + describe 'a special character in the buffer should be treated like any other character' do |
| 3 | + it 'asterisk' do |
4 | 4 | with_history('echo "hello*"', 'echo "hello."') do
|
5 | 5 | session.send_string('echo "hello*')
|
6 | 6 | wait_for { session.content }.to eq('echo "hello*"')
|
7 | 7 | end
|
| 8 | + end |
8 | 9 |
|
| 10 | + it 'question mark' do |
9 | 11 | with_history('echo "hello?"', 'echo "hello."') do
|
10 | 12 | session.send_string('echo "hello?')
|
11 | 13 | wait_for { session.content }.to eq('echo "hello?"')
|
12 | 14 | end
|
| 15 | + end |
13 | 16 |
|
| 17 | + it 'backslash' do |
14 | 18 | with_history('echo "hello\nworld"') do
|
15 | 19 | session.send_string('echo "hello\\')
|
16 | 20 | wait_for { session.content }.to eq('echo "hello\nworld"')
|
17 | 21 | end
|
| 22 | + end |
18 | 23 |
|
| 24 | + it 'double backslash' do |
19 | 25 | with_history('echo "\\\\"') do
|
20 | 26 | session.send_string('echo "\\\\')
|
21 | 27 | wait_for { session.content }.to eq('echo "\\\\"')
|
22 | 28 | end
|
| 29 | + end |
23 | 30 |
|
| 31 | + it 'tilde' do |
24 | 32 | with_history('echo ~/foo') do
|
25 | 33 | session.send_string('echo ~')
|
26 | 34 | wait_for { session.content }.to eq('echo ~/foo')
|
27 | 35 | end
|
| 36 | + end |
28 | 37 |
|
| 38 | + it 'parentheses' do |
29 | 39 | with_history('echo "$(ls foo)"') do
|
30 | 40 | session.send_string('echo "$(')
|
31 | 41 | wait_for { session.content }.to eq('echo "$(ls foo)"')
|
32 | 42 | end
|
| 43 | + end |
33 | 44 |
|
| 45 | + it 'square bracket' do |
34 | 46 | with_history('echo "$history[123]"') do
|
35 | 47 | session.send_string('echo "$history[')
|
36 | 48 | wait_for { session.content }.to eq('echo "$history[123]"')
|
37 | 49 | session.send_string('123]')
|
38 | 50 | wait_for { session.content }.to eq('echo "$history[123]"')
|
39 | 51 | end
|
| 52 | + end |
40 | 53 |
|
| 54 | + it 'octothorpe' do |
41 | 55 | with_history('echo "#yolo"') do
|
42 | 56 | session.send_string('echo "#')
|
43 | 57 | wait_for { session.content }.to eq('echo "#yolo"')
|
44 | 58 | end
|
| 59 | + end |
45 | 60 |
|
46 |
| - with_history('echo "#foo"', 'echo $#abc') do |
47 |
| - session.send_string('echo "#') |
48 |
| - wait_for { session.content }.to eq('echo "#foo"') |
49 |
| - end |
50 |
| - |
| 61 | + it 'caret' do |
51 | 62 | with_history('echo "^A"', 'echo "^B"') do
|
52 | 63 | session.send_string('echo "^A')
|
53 | 64 | wait_for { session.content }.to eq('echo "^A"')
|
54 | 65 | end
|
| 66 | + end |
55 | 67 |
|
| 68 | + it 'dash' do |
56 | 69 | with_history('-foo() {}') do
|
57 | 70 | session.send_string('-')
|
58 | 71 | wait_for { session.content }.to eq('-foo() {}')
|
|
0 commit comments