@@ -451,3 +451,50 @@ fLargeTable() = 4
451451# issue #15280
452452function f15280 (x) end
453453@test functionloc (f15280)[2 ] > 0
454+
455+ # bug found in #16850, Base.url with backslashes on Windows
456+ function module_depth (from:: Module , to:: Module )
457+ if from === to
458+ return 0
459+ else
460+ return 1 + module_depth (from, module_parent (to))
461+ end
462+ end
463+ function has_backslashes (mod:: Module )
464+ for n in names (mod, true , true )
465+ isdefined (mod, n) || continue
466+ f = getfield (mod, n)
467+ if isa (f, Module) && module_depth (Main, f) <= module_depth (Main, mod)
468+ continue
469+ end
470+ h = has_backslashes (f)
471+ isnull (h) || return h
472+ end
473+ return Nullable {Method} ()
474+ end
475+ function has_backslashes (f:: Function )
476+ for m in methods (f)
477+ h = has_backslashes (m)
478+ isnull (h) || return h
479+ end
480+ return Nullable {Method} ()
481+ end
482+ function has_backslashes (meth:: Method )
483+ if ' \\ ' in string (meth. file)
484+ return Nullable {Method} (meth)
485+ else
486+ return Nullable {Method} ()
487+ end
488+ end
489+ has_backslashes (x) = Nullable {Method} ()
490+ h16850 = has_backslashes (Base)
491+ if is_windows ()
492+ if isnull (h16850)
493+ warn (" No methods found in Base with backslashes in file name, " ,
494+ " skipping test for Base.url" )
495+ else
496+ @test ! (' \\ ' in Base. url (get (h16850)))
497+ end
498+ else
499+ @test isnull (h16850)
500+ end
0 commit comments