comparison .zfun/zsh-autosuggestions/spec/strategies/special_characters_helper.rb @ 467:e1ce8897030d

zsh: import df6f6f9ff41 of zsh-autosuggestions
author Augie Fackler <raf@durin42.com>
date Mon, 03 Dec 2018 22:37:29 -0500
parents
children
comparison
equal deleted inserted replaced
466:f248cf012d9a 467:e1ce8897030d
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
4 with_history('echo "hello*"', 'echo "hello."') do
5 session.send_string('echo "hello*')
6 wait_for { session.content }.to eq('echo "hello*"')
7 end
8
9 with_history('echo "hello?"', 'echo "hello."') do
10 session.send_string('echo "hello?')
11 wait_for { session.content }.to eq('echo "hello?"')
12 end
13
14 with_history('echo "hello\nworld"') do
15 session.send_string('echo "hello\\')
16 wait_for { session.content }.to eq('echo "hello\nworld"')
17 end
18
19 with_history('echo "\\\\"') do
20 session.send_string('echo "\\\\')
21 wait_for { session.content }.to eq('echo "\\\\"')
22 end
23
24 with_history('echo ~/foo') do
25 session.send_string('echo ~')
26 wait_for { session.content }.to eq('echo ~/foo')
27 end
28
29 with_history('echo "$(ls foo)"') do
30 session.send_string('echo "$(')
31 wait_for { session.content }.to eq('echo "$(ls foo)"')
32 end
33
34 with_history('echo "$history[123]"') do
35 session.send_string('echo "$history[')
36 wait_for { session.content }.to eq('echo "$history[123]"')
37 session.send_string('123]')
38 wait_for { session.content }.to eq('echo "$history[123]"')
39 end
40
41 with_history('echo "#yolo"') do
42 session.send_string('echo "#')
43 wait_for { session.content }.to eq('echo "#yolo"')
44 end
45
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
51 with_history('echo "^A"', 'echo "^B"') do
52 session.send_string('echo "^A')
53 wait_for { session.content }.to eq('echo "^A"')
54 end
55
56 with_history('-foo() {}') do
57 session.send_string('-')
58 wait_for { session.content }.to eq('-foo() {}')
59 end
60 end
61 end
62 end