From 65f850cf4405ea87b1cca0797989164978ee8073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Fri, 25 Oct 2024 11:47:35 +0200 Subject: [PATCH] Refactor test/dune and add a failing test The failing test shows how writes during a change_and_push are not readable. --- test/dune | 11 +++++++++-- test/fold2.t | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 test/fold2.t diff --git a/test/dune b/test/dune index 1c0a228..45a02f5 100644 --- a/test/dune +++ b/test/dune @@ -1,14 +1,21 @@ +(env (_ (binaries (../app/mgit.exe as mgit)))) (cram (package git-kv) (applies_to simple) (locks p9418) - (deps %{exe:../app/mgit.exe})) + (deps %{bin:mgit})) (cram (package git-kv) (applies_to fold) (locks p9418) - (deps %{exe:../app/mgit.exe})) + (deps %{bin:mgit})) + +(cram + (package git-kv) + (applies_to fold2) + (locks p9418) + (deps %{bin:mgit})) (executable (name git_daemon_exists) diff --git a/test/fold2.t b/test/fold2.t new file mode 100644 index 0000000..5cd2548 --- /dev/null +++ b/test/fold2.t @@ -0,0 +1,16 @@ +Reading during batch operation + $ mkdir simple + $ git init --bare -q simple 2> /dev/null + $ git daemon --base-path=. --export-all --enable=receive-pack --reuseaddr --pid-file=pid --detach + $ mgit git://localhost/simple#main << EOF + > fold + > set /bar "Git rocks!" + > get /bar + > quit + > quit + 00000000: 4769 7420 726f 636b 7321 Git rocks! + $ cd simple + $ git log main --pretty=oneline | wc -l + 1 + $ cd .. + $ kill $(cat pid)