@@ -198,28 +198,33 @@ defmodule ExUnit.FiltersTest do
198
198
windows_path = "C:\\ some\\ path.exs"
199
199
200
200
for path <- [ unix_path , windows_path ] do
201
+ fixed_path = path |> Path . split ( ) |> Path . join ( )
202
+
201
203
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 } ] ] }
203
205
204
- assert ExUnit.Filters . parse_path ( path ) == { path , [ ] }
206
+ assert ExUnit.Filters . parse_path ( path ) == { fixed_path , [ ] }
205
207
206
208
assert ExUnit.Filters . parse_path ( "#{ path } :123notreallyalinenumber123" ) ==
207
- { "#{ path } :123notreallyalinenumber123" , [ ] }
209
+ { "#{ fixed_path } :123notreallyalinenumber123" , [ ] }
208
210
209
211
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 ] } ] ] }
211
213
212
214
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
+ ] }
215
220
216
221
output =
217
222
ExUnit.CaptureIO . capture_io ( :stderr , fn ->
218
223
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 } ] } ] }
220
225
221
226
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 ] } ] ] }
223
228
end )
224
229
225
230
assert output =~ "invalid line number given as ExUnit filter: 456notalinenumber456"
@@ -231,25 +236,25 @@ defmodule ExUnit.FiltersTest do
231
236
test "multiple file paths with line numbers" do
232
237
unix_path = "test/some/path.exs"
233
238
windows_path = "C:\\ some\\ path.exs"
234
- other_unix_path = "test/some/other_path.exs"
239
+ other_unix_path = "test// some/ /other_path.exs"
235
240
other_windows_path = "C:\\ some\\ other_path.exs"
236
241
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
+
241
246
assert ExUnit.Filters . parse_paths ( [ path , "#{ other_path } :456:789" ] ) ==
242
- { [ path , other_path ] ,
247
+ { [ fixed_path , fixed_other_path ] ,
243
248
[
244
249
exclude: [ :test ] ,
245
- include: [ location: { other_path , [ 456 , 789 ] } ]
250
+ include: [ location: { fixed_other_path , [ 456 , 789 ] } ]
246
251
] }
247
252
248
253
assert ExUnit.Filters . parse_paths ( [ "#{ path } :123" , "#{ other_path } :456" ] ) ==
249
- { [ path , other_path ] ,
254
+ { [ fixed_path , fixed_other_path ] ,
250
255
[
251
256
exclude: [ :test ] ,
252
- include: [ location: { path , 123 } , location: { other_path , 456 } ]
257
+ include: [ location: { fixed_path , 123 } , location: { fixed_other_path , 456 } ]
253
258
] }
254
259
255
260
output =
@@ -258,12 +263,12 @@ defmodule ExUnit.FiltersTest do
258
263
"#{ path } :123:0:-789:456" ,
259
264
"#{ other_path } :321:0:-987:654"
260
265
] ) ==
261
- { [ path , other_path ] ,
266
+ { [ fixed_path , fixed_other_path ] ,
262
267
[
263
268
exclude: [ :test ] ,
264
269
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 ] }
267
272
]
268
273
] }
269
274
end )
0 commit comments