Skip to content

Commit f6856e4

Browse files
committed
Actually test something
1 parent 33e51ab commit f6856e4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/runtests.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ end
4848
# (<https://github.com/JuliaVersionControl/Git.jl/issues/40>) works correctly. While we run
4949
# into that issue only on macOS, it's good to test it everywhere.
5050
@testset "SIP workaround" begin
51-
gitd(dir, cmd) = run(`$(git()) -C $(dir) -c "user.name=a" -c "user.email=b@c" $(cmd)`)
51+
gitd(dir, cmd; stdout=Base.stdout, stderr=Base.stderr) =
52+
run(pipeline(`$(git()) -C $(dir) -c "user.name=a" -c "user.email=b@c" $(cmd)`;
53+
stdout, stderr))
5254
branch = "dev"
5355
mktempdir() do dir1; mktempdir() do dir2;
5456
gitd(dir1, `init --bare --quiet --initial-branch $(branch)`)
@@ -60,5 +62,12 @@ end
6062
gitd(dir2, `commit --quiet -m test`)
6163
gitd(dir2, `remote add origin file://$(dir1)`)
6264
gitd(dir2, `push --quiet --set-upstream origin $(branch)`)
65+
dir1_io, dir2_io = IOBuffer(), IOBuffer()
66+
gitd(dir1, `log`; stdout=dir1_io)
67+
gitd(dir2, `log`; stdout=dir2_io)
68+
# Make sure the logs are the same for the two repositories
69+
dir1_log, dir2_log = String.(take!.((dir1_io, dir2_io)))
70+
@test !isempty(dir1_log) === !isempty(dir2_log) === true
71+
@test dir1_log == dir2_log
6372
end; end
6473
end

0 commit comments

Comments
 (0)