@@ -26,14 +26,18 @@ func Read_socket()
26
26
endif
27
27
endfunc
28
28
29
+ func Strip_hl (s )
30
+ return substitute (a: s , ' #\[[^\]]*\]' , ' ' , ' g' )
31
+ endfunc
32
+
29
33
func Test_autoembed ()
30
34
call assert_equal (' status-left "#(cat #{socket_path}-\\#{session_id}-vimbridge)"' , trim (system (' tmux show-options status-left' )))
31
35
endfunc
32
36
33
37
func Test_socket ()
34
38
let g: tpipeline_statusline = ' test'
35
39
call Read_socket ()
36
- call assert_match (' test' , s: left )
40
+ call assert_equal (' test' , Strip_hl ( s: left) )
37
41
endfunc
38
42
39
43
func Test_colors ()
@@ -47,15 +51,15 @@ endfunc
47
51
func Test_focusevents ()
48
52
let g: tpipeline_statusline = ' focused'
49
53
call Read_socket ()
50
- call assert_match (' focused' , s: left )
54
+ call assert_equal (' focused' , Strip_hl ( s: left) )
51
55
" lose focus
52
56
call tpipeline#deferred_cleanup ()
53
57
call Read_socket ()
54
- call assert_notmatch (' focused' , s: left )
58
+ call assert_notequal (' focused' , Strip_hl ( s: left) )
55
59
" gain focus
56
60
call tpipeline#forceupdate ()
57
61
call Read_socket ()
58
- call assert_match (' focused' , s: left )
62
+ call assert_equal (' focused' , Strip_hl ( s: left) )
59
63
endfunc
60
64
61
65
func Test_rapidfocus ()
@@ -64,16 +68,16 @@ func Test_rapidfocus()
64
68
call tpipeline#deferred_cleanup ()
65
69
call tpipeline#forceupdate ()
66
70
call Read_socket ()
67
- call assert_match (' focused' , s: left )
71
+ call assert_equal (' focused' , Strip_hl ( s: left) )
68
72
endfunc
69
73
70
74
func Test_split ()
71
75
let g: tpipeline_statusline = ' LEFT%=RIGHT'
72
76
call Read_socket ()
73
- call assert_match (' LEFT' , s: left )
74
- call assert_notmatch (' RIGHT' , s: left )
75
- call assert_match (' RIGHT' , s: right )
76
- call assert_notmatch (' LEFT' , s: right )
77
+ call assert_equal (' LEFT' , Strip_hl ( s: left) )
78
+ call assert_notequal (' RIGHT' , Strip_hl ( s: left) )
79
+ call assert_equal (' RIGHT' , Strip_hl ( s: right) )
80
+ call assert_notequal (' LEFT' , Strip_hl ( s: right) )
77
81
endfunc
78
82
79
83
" test that if a vim window is much smaller than the console window, that we still use the entire space available
@@ -93,8 +97,8 @@ func Test_small_pane()
93
97
" This especially means that the right part is NOT empty.
94
98
call Read_socket ()
95
99
call assert_false (empty (s: right ))
96
- call assert_match (left , s: left )
97
- call assert_match (right , s: right )
100
+ call assert_equal (left , Strip_hl ( s: left) )
101
+ call assert_equal (right , Strip_hl ( s: right) )
98
102
99
103
bd !
100
104
endfunc
@@ -104,8 +108,8 @@ func Test_unicode()
104
108
let right = " 🛠⛏🪚🔩"
105
109
let g: tpipeline_statusline = " %#String#" . left . " %=%#Error#" . right
106
110
call Read_socket ()
107
- call assert_match (left , s: left )
108
- call assert_match (right , s: right )
111
+ call assert_equal (left , Strip_hl ( s: left) )
112
+ call assert_equal (right , Strip_hl ( s: right) )
109
113
endfunc
110
114
111
115
func Test_performance ()
@@ -183,11 +187,11 @@ endfunc
183
187
func Test_number_evaluation ()
184
188
let g: tpipeline_statusline = " %{g:ReturnNumber()}"
185
189
call Read_socket ()
186
- call assert_match (string (g: ReturnNumber ()), s: left )
190
+ call assert_equal (string (g: ReturnNumber ()), Strip_hl ( s: left) )
187
191
endfunc
188
192
189
193
func Test_quoted_strings ()
190
194
let g: tpipeline_statusline = ' %{eval("g:ReturnNumber()")}'
191
195
call Read_socket ()
192
- call assert_match (string (g: ReturnNumber ()), s: left )
196
+ call assert_equal (string (g: ReturnNumber ()), Strip_hl ( s: left) )
193
197
endfunc
0 commit comments