Skip to content

Move realpath() earlier in cmdlineargs test #34506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stdlib/LibGit2/test/libgit2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ end
end

mktempdir() do dir
dir = realpath(dir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is needed on Windows, shouldn’t it be part of the mktempdir implementation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think probably yes.

# test parameters
repo_url = "https://github.com/JuliaLang/Example.jl"
cache_repo = joinpath(dir, "Example")
Expand Down
2 changes: 1 addition & 1 deletion stdlib/REPL/test/replcompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ end
if Sys.iswindows()
tmp = tempname()
touch(tmp)
path = dirname(tmp)
path = realpath(dirname(tmp))
file = basename(tmp)
temp_name = basename(path)
cd(path) do
Expand Down
11 changes: 7 additions & 4 deletions test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ let exename = `$(Base.julia_cmd()) --startup-file=no`

# test the program name remains constant
mktempdir() do dir
# dir can be case-incorrect sometimes
dir = realpath(dir)

a = joinpath(dir, "a.jl")
b = joinpath(dir, "b.jl")
c = joinpath(dir, ".julia", "config", "startup.jl")
Expand All @@ -439,19 +442,19 @@ let exename = `$(Base.julia_cmd()) --startup-file=no`
[a, a,
b, a]
@test readsplit(`$exename -L $b -e 'exit(0)'`) ==
[realpath(b), ""]
[b, ""]
@test readsplit(`$exename -L $b $a`) ==
[realpath(b), a,
[b, a,
a, a,
b, a]
@test readsplit(`$exename --startup-file=yes -e 'exit(0)'`) ==
[c, ""]
@test readsplit(`$exename --startup-file=yes -L $b -e 'exit(0)'`) ==
[c, "",
realpath(b), ""]
b, ""]
@test readsplit(`$exename --startup-file=yes -L $b $a`) ==
[c, a,
realpath(b), a,
b, a,
a, a,
b, a]
end
Expand Down