Skip to content

Commit

Permalink
file creation tests: check path existence before & after (#29994)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Nov 10, 2018
1 parent e01733b commit c50aaea
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions test/file.jl
Expand Up @@ -1015,15 +1015,28 @@ rm(dir)
mktempdir() do dir
name1 = joinpath(dir, "apples")
name2 = joinpath(dir, "bannanas")
@test touch(name1) == name1 # when it doesn't exist
@test touch(name1) == name1 # when it does exist
@test !ispath(name1)
@test touch(name1) == name1
@test isfile(name1)
@test touch(name1) == name1
@test isfile(name1)
@test !ispath(name2)
@test mv(name1, name2) == name2
@test !ispath(name1)
@test isfile(name2)
@test cp(name2, name1) == name1
@test isfile(name1)
@test isfile(name2)
namedir = joinpath(dir, "chalk")
namepath = joinpath(dir, "chalk","cheese","fresh")
@test mkdir(namedir) == namedir # when it doesn't exist
@test mkpath(namepath) == namepath # when it doesn't exist
@test mkpath(namepath) == namepath # when it does exist
@test !ispath(namedir)
@test mkdir(namedir) == namedir
@test isdir(namedir)
@test !ispath(namepath)
@test mkpath(namepath) == namepath
@test isdir(namepath)
@test mkpath(namepath) == namepath
@test isdir(namepath)
end


Expand Down

0 comments on commit c50aaea

Please sign in to comment.