Skip to content

Commit 67ef0b1

Browse files
author
Bruno Sutic
committed
Tests for unicode chars in lines with results
When in the same line as the result, unicode characters are causing issues. The result selection is often misplaced by a couple characters (because unicode characters are often multi-byte). Using `gawk` fixes the issue.
1 parent 6e8272a commit 67ef0b1

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

test/test_url_search.exp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@ tmux_ctrl_u
127127
next_match
128128
assert_highlighted "http://example112.com" "2 matches on the same line, second match"
129129

130+
# works ok even with unicode characters in the line (requires gawk to be installed)
131+
#--------------------------------------------------
132+
new_tmux_pane
133+
display_text "Ξ ~CM_CONF_DIR → curl http://www.google.com"
134+
tmux_ctrl_u
135+
assert_highlighted "http://www.google.com" "match on the line with unicode characters"
136+
137+
display_text "↑127 ~CM_CONF_DIR → echo http://www.google.com"
138+
tmux_ctrl_u
139+
assert_highlighted "http://www.google.com" "another match on the line with unicode characters"
140+
130141
# no match, first and last match
131142
#-------------------------------
132143
new_tmux_pane

vagrant_centos_provisioning.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ chown -R vagrant:vagrant /home/vagrant/.irbrc
1212
sudo su -
1313

1414
yum -y install gcc kernel-devel make ncurses-devel
15-
yum -y install git-core expect vim ruby ruby-devel ruby-irb
15+
yum -y install git-core expect vim gawk ruby ruby-devel ruby-irb
1616

1717
# download tmux and libevent
1818
mkdir ~/downloads && cd ~/downloads

vagrant_ubuntu_provisioning.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ echo 'IRB.conf[:PROMPT_MODE] = :SIMPLE' >> /home/vagrant/.irbrc
77
chown -R vagrant:vagrant /home/vagrant/.irbrc
88

99
sudo apt-get update
10-
sudo apt-get install -y git-core expect vim
10+
sudo apt-get install -y git-core expect vim gawk
1111
sudo apt-get install -y python-software-properties software-properties-common
1212

1313
# install latest Tmux 1.9a

0 commit comments

Comments
 (0)