File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -520,20 +520,21 @@ end
520520 @test my_tempdir[end ] != ' \\ '
521521
522522 var = Sys. iswindows () ? " TMP" : " TMPDIR"
523- PATH_PREFIX = Sys. iswindows () ? " C:\\ " : " /tmp/"
523+ PATH_PREFIX = Sys. iswindows () ? " C:\\ " : " /tmp/" * " x " ^ 255 # we want a long path on UNIX so that we test buffer resizing in `tempdir`
524524 # Warning: On Windows uv_os_tmpdir internally calls GetTempPathW. The max string length for
525525 # GetTempPathW is 261 (including the implied trailing backslash), not the typical length 259.
526- # We thus use 260 (with implied trailing slash backlash this then gives 261 chars) and
527- # subtract 9 to account for i = 0:9.
528- MAX_PATH = (Sys. iswindows () ? 260 - 9 : 1024 ) - length (PATH_PREFIX)
526+ # We thus use 260 (with implied trailing slash backlash this then gives 261 chars)
527+ # NOTE: not the actual max path on UNIX, but true in the Windows case for this function.
528+ # NOTE: we subtract 9 to account for i = 0:9.
529+ MAX_PATH = (Sys. iswindows () ? 260 - length (PATH_PREFIX) : 255 ) - 9
529530 for i = 0 : 8
530- local tmp = PATH_PREFIX * " x" ^ MAX_PATH * " 123456789" [1 : i]
531+ local tmp = joinpath ( PATH_PREFIX, " x" ^ MAX_PATH * " 123456789" [1 : i])
531532 @test withenv (var => tmp) do
532533 tempdir ()
533534 end == (tmp)
534535 end
535536 for i = 9
536- local tmp = PATH_PREFIX * " x" ^ MAX_PATH * " 123456789" [1 : i]
537+ local tmp = joinpath ( PATH_PREFIX, " x" ^ MAX_PATH * " 123456789" [1 : i])
537538 if Sys. iswindows ()
538539 # libuv bug
539540 @test_broken withenv (var => tmp) do
You can’t perform that action at this time.
0 commit comments