|
159 | 159 | @test String(read(joinpath(dstdir, "sym_fileC"))) == "fileC\n"
|
160 | 160 | @test_throws Base.IOError realpath(joinpath(dstdir, "sym_fileB"))
|
161 | 161 | end
|
| 162 | + |
| 163 | + @testset "Warnings about clashing files" begin |
| 164 | + mktempdir() do tmpdir |
| 165 | + # Create fake source directory |
| 166 | + srcdir = joinpath(tmpdir, "src") |
| 167 | + mkdir(srcdir) |
| 168 | + # Write two files inside the source directory |
| 169 | + srcfile1 = joinpath(srcdir, "file1") |
| 170 | + text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" |
| 171 | + write(srcfile1, text) |
| 172 | + srcfile2 = joinpath(srcdir, "file2") |
| 173 | + write(srcfile2, text ^ 2) |
| 174 | + |
| 175 | + # Create the destination directory |
| 176 | + destdir = joinpath(tmpdir, "dest") |
| 177 | + mkdir(destdir) |
| 178 | + destfile1 = joinpath(destdir, "file1") |
| 179 | + # Same text as file1 in the source directory |
| 180 | + write(destfile1, text) |
| 181 | + destfile2 = joinpath(destdir, "file2") |
| 182 | + # Different text from file2 in the source directory |
| 183 | + write(destfile2, text) |
| 184 | + |
| 185 | + # Set up a symlink tree inside of destdir: make sure only the warning about file2 is issued |
| 186 | + @test_logs (:warn, "Symlink file2 from artifact src already exists in artifact file2") BinaryBuilderBase.symlink_tree(srcdir, destdir) |
| 187 | + BinaryBuilderBase.unsymlink_tree(srcdir, destdir) |
| 188 | + end |
| 189 | + end |
162 | 190 | end
|
163 | 191 |
|
164 | 192 | @testset "Compression" begin
|
|
0 commit comments