@@ -115,83 +115,83 @@ for str in [u8str]
115115end
116116
117117# string forward search with a single-char string
118- @test findfirst (" x" , astr) == 0 : - 1
118+ @test findfirst (" x" , astr) == nothing
119119@test findfirst (" H" , astr) == 1 : 1
120- @test findnext (" H" , astr, 2 ) == 0 : - 1
120+ @test findnext (" H" , astr, 2 ) == nothing
121121@test findfirst (" l" , astr) == 3 : 3
122122@test findnext (" l" , astr, 4 ) == 4 : 4
123123@test findnext (" l" , astr, 5 ) == 11 : 11
124- @test findnext (" l" , astr, 12 ) == 0 : - 1
124+ @test findnext (" l" , astr, 12 ) == nothing
125125@test findfirst (" \n " , astr) == 14 : 14
126- @test findnext (" \n " , astr, 15 ) == 0 : - 1
126+ @test findnext (" \n " , astr, 15 ) == nothing
127127
128- @test findfirst (" z" , u8str) == 0 : - 1
129- @test findfirst (" ∄" , u8str) == 0 : - 1
128+ @test findfirst (" z" , u8str) == nothing
129+ @test findfirst (" ∄" , u8str) == nothing
130130@test findfirst (" ∀" , u8str) == 1 : 1
131- @test findnext (" ∀" , u8str, 4 ) == 0 : - 1
131+ @test findnext (" ∀" , u8str, 4 ) == nothing
132132@test findfirst (" ∃" , u8str) == 13 : 13
133- @test findnext (" ∃" , u8str, 16 ) == 0 : - 1
133+ @test findnext (" ∃" , u8str, 16 ) == nothing
134134@test findfirst (" x" , u8str) == 26 : 26
135135@test findnext (" x" , u8str, 27 ) == 43 : 43
136- @test findnext (" x" , u8str, 44 ) == 0 : - 1
136+ @test findnext (" x" , u8str, 44 ) == nothing
137137@test findfirst (" ε" , u8str) == 5 : 5
138138@test findnext (" ε" , u8str, 7 ) == 54 : 54
139- @test findnext (" ε" , u8str, 56 ) == 0 : - 1
139+ @test findnext (" ε" , u8str, 56 ) == nothing
140140
141141# strifindprev backward search with a single-char string
142- @test findlast (" x" , astr) == 0 : - 1
142+ @test findlast (" x" , astr) == nothing
143143@test findlast (" H" , astr) == 1 : 1
144144@test findprev (" H" , astr, 2 ) == 1 : 1
145- @test findprev (" H" , astr, 0 ) == 0 : - 1
145+ @test findprev (" H" , astr, 0 ) == nothing
146146@test findlast (" l" , astr) == 11 : 11
147147@test findprev (" l" , astr, 10 ) == 4 : 4
148148@test findprev (" l" , astr, 4 ) == 4 : 4
149149@test findprev (" l" , astr, 3 ) == 3 : 3
150- @test findprev (" l" , astr, 2 ) == 0 : - 1
150+ @test findprev (" l" , astr, 2 ) == nothing
151151@test findlast (" \n " , astr) == 14 : 14
152- @test findprev (" \n " , astr, 13 ) == 0 : - 1
152+ @test findprev (" \n " , astr, 13 ) == nothing
153153
154- @test findlast (" z" , u8str) == 0 : - 1
155- @test findlast (" ∄" , u8str) == 0 : - 1
154+ @test findlast (" z" , u8str) == nothing
155+ @test findlast (" ∄" , u8str) == nothing
156156@test findlast (" ∀" , u8str) == 1 : 1
157- @test findprev (" ∀" , u8str, 0 ) == 0 : - 1
157+ @test findprev (" ∀" , u8str, 0 ) == nothing
158158# TODO : setting the limit in the middle of a wide char
159159# makes findnext fail but findprev succeed.
160160# Should findprev fail as well?
161- # @test findprev("∀", u8str, 2) == 0:-1 # gives 1:3
161+ # @test findprev("∀", u8str, 2) == nothing # gives 1:3
162162@test findlast (" ∃" , u8str) == 13 : 13
163- @test findprev (" ∃" , u8str, 12 ) == 0 : - 1
163+ @test findprev (" ∃" , u8str, 12 ) == nothing
164164@test findlast (" x" , u8str) == 43 : 43
165165@test findprev (" x" , u8str, 42 ) == 26 : 26
166- @test findprev (" x" , u8str, 25 ) == 0 : - 1
166+ @test findprev (" x" , u8str, 25 ) == nothing
167167@test findlast (" ε" , u8str) == 54 : 54
168168@test findprev (" ε" , u8str, 53 ) == 5 : 5
169- @test findprev (" ε" , u8str, 4 ) == 0 : - 1
169+ @test findprev (" ε" , u8str, 4 ) == nothing
170170
171171# string forward search with a single-char regex
172- @test findfirst (r" x" , astr) == 0 : - 1
172+ @test findfirst (r" x" , astr) == nothing
173173@test findfirst (r" H" , astr) == 1 : 1
174- @test findnext (r" H" , astr, 2 ) == 0 : - 1
174+ @test findnext (r" H" , astr, 2 ) == nothing
175175@test findfirst (r" l" , astr) == 3 : 3
176176@test findnext (r" l" , astr, 4 ) == 4 : 4
177177@test findnext (r" l" , astr, 5 ) == 11 : 11
178- @test findnext (r" l" , astr, 12 ) == 0 : - 1
178+ @test findnext (r" l" , astr, 12 ) == nothing
179179@test findfirst (r" \n " , astr) == 14 : 14
180- @test findnext (r" \n " , astr, 15 ) == 0 : - 1
181- @test findfirst (r" z" , u8str) == 0 : - 1
182- @test findfirst (r" ∄" , u8str) == 0 : - 1
180+ @test findnext (r" \n " , astr, 15 ) == nothing
181+ @test findfirst (r" z" , u8str) == nothing
182+ @test findfirst (r" ∄" , u8str) == nothing
183183@test findfirst (r" ∀" , u8str) == 1 : 1
184- @test findnext (r" ∀" , u8str, 4 ) == 0 : - 1
184+ @test findnext (r" ∀" , u8str, 4 ) == nothing
185185@test findfirst (r" ∀" , u8str) == findfirst (r" \u 2200" , u8str)
186186@test findnext (r" ∀" , u8str, 4 ) == findnext (r" \u 2200" , u8str, 4 )
187187@test findfirst (r" ∃" , u8str) == 13 : 13
188- @test findnext (r" ∃" , u8str, 16 ) == 0 : - 1
188+ @test findnext (r" ∃" , u8str, 16 ) == nothing
189189@test findfirst (r" x" , u8str) == 26 : 26
190190@test findnext (r" x" , u8str, 27 ) == 43 : 43
191- @test findnext (r" x" , u8str, 44 ) == 0 : - 1
191+ @test findnext (r" x" , u8str, 44 ) == nothing
192192@test findfirst (r" ε" , u8str) == 5 : 5
193193@test findnext (r" ε" , u8str, 7 ) == 54 : 54
194- @test findnext (r" ε" , u8str, 56 ) == 0 : - 1
194+ @test findnext (r" ε" , u8str, 56 ) == nothing
195195for i = 1 : lastindex (astr)
196196 @test findnext (r" ." s , astr, i) == i: i
197197end
@@ -231,18 +231,18 @@ for i = 1:lastindex(u8str)
231231end
232232
233233# string forward search with a two-char string literal
234- @test findfirst (" xx" , " foo,bar,baz" ) == 0 : - 1
234+ @test findfirst (" xx" , " foo,bar,baz" ) == nothing
235235@test findfirst (" fo" , " foo,bar,baz" ) == 1 : 2
236- @test findnext (" fo" , " foo,bar,baz" , 3 ) == 0 : - 1
236+ @test findnext (" fo" , " foo,bar,baz" , 3 ) == nothing
237237@test findfirst (" oo" , " foo,bar,baz" ) == 2 : 3
238- @test findnext (" oo" , " foo,bar,baz" , 4 ) == 0 : - 1
238+ @test findnext (" oo" , " foo,bar,baz" , 4 ) == nothing
239239@test findfirst (" o," , " foo,bar,baz" ) == 3 : 4
240- @test findnext (" o," , " foo,bar,baz" , 5 ) == 0 : - 1
240+ @test findnext (" o," , " foo,bar,baz" , 5 ) == nothing
241241@test findfirst (" ,b" , " foo,bar,baz" ) == 4 : 5
242242@test findnext (" ,b" , " foo,bar,baz" , 6 ) == 8 : 9
243- @test findnext (" ,b" , " foo,bar,baz" , 10 ) == 0 : - 1
243+ @test findnext (" ,b" , " foo,bar,baz" , 10 ) == nothing
244244@test findfirst (" az" , " foo,bar,baz" ) == 10 : 11
245- @test findnext (" az" , " foo,bar,baz" , 12 ) == 0 : - 1
245+ @test findnext (" az" , " foo,bar,baz" , 12 ) == nothing
246246
247247# issue #9365
248248# string forward search with a two-char UTF-8 (2 byte) string literal
@@ -286,32 +286,32 @@ end
286286@test findprev (" \U 1f596\U 1f596" , " \U 1f596\U 1f596" , lastindex (" \U 1f596\U 1f596\U 1f596" )) == 1 : 5
287287
288288# string backward search with a two-char string literal
289- @test findlast (" xx" , " foo,bar,baz" ) == 0 : - 1
289+ @test findlast (" xx" , " foo,bar,baz" ) == nothing
290290@test findlast (" fo" , " foo,bar,baz" ) == 1 : 2
291- @test findprev (" fo" , " foo,bar,baz" , 1 ) == 0 : - 1
291+ @test findprev (" fo" , " foo,bar,baz" , 1 ) == nothing
292292@test findlast (" oo" , " foo,bar,baz" ) == 2 : 3
293- @test findprev (" oo" , " foo,bar,baz" , 2 ) == 0 : - 1
293+ @test findprev (" oo" , " foo,bar,baz" , 2 ) == nothing
294294@test findlast (" o," , " foo,bar,baz" ) == 3 : 4
295- @test findprev (" o," , " foo,bar,baz" , 1 ) == 0 : - 1
295+ @test findprev (" o," , " foo,bar,baz" , 1 ) == nothing
296296@test findlast (" ,b" , " foo,bar,baz" ) == 8 : 9
297297@test findprev (" ,b" , " foo,bar,baz" , 6 ) == 4 : 5
298- @test findprev (" ,b" , " foo,bar,baz" , 3 ) == 0 : - 1
298+ @test findprev (" ,b" , " foo,bar,baz" , 3 ) == nothing
299299@test findlast (" az" , " foo,bar,baz" ) == 10 : 11
300- @test findprev (" az" , " foo,bar,baz" , 10 ) == 0 : - 1
300+ @test findprev (" az" , " foo,bar,baz" , 10 ) == nothing
301301
302302# string search with a two-char regex
303- @test findfirst (r" xx" , " foo,bar,baz" ) == 0 : - 1
303+ @test findfirst (r" xx" , " foo,bar,baz" ) == nothing
304304@test findfirst (r" fo" , " foo,bar,baz" ) == 1 : 2
305- @test findnext (r" fo" , " foo,bar,baz" , 3 ) == 0 : - 1
305+ @test findnext (r" fo" , " foo,bar,baz" , 3 ) == nothing
306306@test findfirst (r" oo" , " foo,bar,baz" ) == 2 : 3
307- @test findnext (r" oo" , " foo,bar,baz" , 4 ) == 0 : - 1
307+ @test findnext (r" oo" , " foo,bar,baz" , 4 ) == nothing
308308@test findfirst (r" o," , " foo,bar,baz" ) == 3 : 4
309- @test findnext (r" o," , " foo,bar,baz" , 5 ) == 0 : - 1
309+ @test findnext (r" o," , " foo,bar,baz" , 5 ) == nothing
310310@test findfirst (r" ,b" , " foo,bar,baz" ) == 4 : 5
311311@test findnext (r" ,b" , " foo,bar,baz" , 6 ) == 8 : 9
312- @test findnext (r" ,b" , " foo,bar,baz" , 10 ) == 0 : - 1
312+ @test findnext (r" ,b" , " foo,bar,baz" , 10 ) == nothing
313313@test findfirst (r" az" , " foo,bar,baz" ) == 10 : 11
314- @test findnext (r" az" , " foo,bar,baz" , 12 ) == 0 : - 1
314+ @test findnext (r" az" , " foo,bar,baz" , 12 ) == nothing
315315
316316# contains with a String and Char needle
317317@test contains (" foo" , " o" )
0 commit comments