@@ -198,28 +198,33 @@ defmodule ExUnit.FiltersTest do
198198 windows_path = "C:\\ some\\ path.exs"
199199
200200 for path <- [ unix_path , windows_path ] do
201+ fixed_path = path |> Path . split ( ) |> Path . join ( )
202+
201203 assert ExUnit.Filters . parse_path ( "#{ path } :123" ) ==
202- { path , [ exclude: [ :test ] , include: [ location: { path , 123 } ] ] }
204+ { fixed_path , [ exclude: [ :test ] , include: [ location: { fixed_path , 123 } ] ] }
203205
204- assert ExUnit.Filters . parse_path ( path ) == { path , [ ] }
206+ assert ExUnit.Filters . parse_path ( path ) == { fixed_path , [ ] }
205207
206208 assert ExUnit.Filters . parse_path ( "#{ path } :123notreallyalinenumber123" ) ==
207- { "#{ path } :123notreallyalinenumber123" , [ ] }
209+ { "#{ fixed_path } :123notreallyalinenumber123" , [ ] }
208210
209211 assert ExUnit.Filters . parse_path ( "#{ path } :123:456" ) ==
210- { path , [ exclude: [ :test ] , include: [ location: { path , [ 123 , 456 ] } ] ] }
212+ { fixed_path , [ exclude: [ :test ] , include: [ location: { fixed_path , [ 123 , 456 ] } ] ] }
211213
212214 assert ExUnit.Filters . parse_path ( "#{ path } :123notalinenumber123:456" ) ==
213- { "#{ path } :123notalinenumber123" ,
214- [ exclude: [ :test ] , include: [ location: { "#{ path } :123notalinenumber123" , 456 } ] ] }
215+ { "#{ fixed_path } :123notalinenumber123" ,
216+ [
217+ exclude: [ :test ] ,
218+ include: [ location: { "#{ fixed_path } :123notalinenumber123" , 456 } ]
219+ ] }
215220
216221 output =
217222 ExUnit.CaptureIO . capture_io ( :stderr , fn ->
218223 assert ExUnit.Filters . parse_path ( "#{ path } :123:456notalinenumber456" ) ==
219- { path , [ { :exclude , [ :test ] } , { :include , [ location: { path , 123 } ] } ] }
224+ { fixed_path , [ { :exclude , [ :test ] } , { :include , [ location: { fixed_path , 123 } ] } ] }
220225
221226 assert ExUnit.Filters . parse_path ( "#{ path } :123:0:-789:456" ) ==
222- { path , [ exclude: [ :test ] , include: [ location: { path , [ 123 , 456 ] } ] ] }
227+ { fixed_path , [ exclude: [ :test ] , include: [ location: { fixed_path , [ 123 , 456 ] } ] ] }
223228 end )
224229
225230 assert output =~ "invalid line number given as ExUnit filter: 456notalinenumber456"
@@ -231,25 +236,25 @@ defmodule ExUnit.FiltersTest do
231236 test "multiple file paths with line numbers" do
232237 unix_path = "test/some/path.exs"
233238 windows_path = "C:\\ some\\ path.exs"
234- other_unix_path = "test/some/other_path.exs"
239+ other_unix_path = "test// some/ /other_path.exs"
235240 other_windows_path = "C:\\ some\\ other_path.exs"
236241
237- for { path , other_path } <- [
238- { unix_path , other_unix_path } ,
239- { windows_path , other_windows_path }
240- ] do
242+ for { path , other_path } <- [ { unix_path , other_unix_path } , { windows_path , other_windows_path } ] do
243+ fixed_path = path |> Path . split ( ) |> Path . join ( )
244+ fixed_other_path = other_path |> Path . split ( ) |> Path . join ( )
245+
241246 assert ExUnit.Filters . parse_paths ( [ path , "#{ other_path } :456:789" ] ) ==
242- { [ path , other_path ] ,
247+ { [ fixed_path , fixed_other_path ] ,
243248 [
244249 exclude: [ :test ] ,
245- include: [ location: { other_path , [ 456 , 789 ] } ]
250+ include: [ location: { fixed_other_path , [ 456 , 789 ] } ]
246251 ] }
247252
248253 assert ExUnit.Filters . parse_paths ( [ "#{ path } :123" , "#{ other_path } :456" ] ) ==
249- { [ path , other_path ] ,
254+ { [ fixed_path , fixed_other_path ] ,
250255 [
251256 exclude: [ :test ] ,
252- include: [ location: { path , 123 } , location: { other_path , 456 } ]
257+ include: [ location: { fixed_path , 123 } , location: { fixed_other_path , 456 } ]
253258 ] }
254259
255260 output =
@@ -258,12 +263,12 @@ defmodule ExUnit.FiltersTest do
258263 "#{ path } :123:0:-789:456" ,
259264 "#{ other_path } :321:0:-987:654"
260265 ] ) ==
261- { [ path , other_path ] ,
266+ { [ fixed_path , fixed_other_path ] ,
262267 [
263268 exclude: [ :test ] ,
264269 include: [
265- location: { path , [ 123 , 456 ] } ,
266- location: { other_path , [ 321 , 654 ] }
270+ location: { fixed_path , [ 123 , 456 ] } ,
271+ location: { fixed_other_path , [ 321 , 654 ] }
267272 ]
268273 ] }
269274 end )
0 commit comments