From 8067811f8395448a5db1a8697f5e9a33963a52a9 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 26 Aug 2022 02:16:14 +0000 Subject: [PATCH] test: ensure that empty directory is packed into embededfs --- tests/run-make/readdir/Makefile | 1 + tests/run-make/readdir/main.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/run-make/readdir/Makefile b/tests/run-make/readdir/Makefile index 2761441..43f739e 100644 --- a/tests/run-make/readdir/Makefile +++ b/tests/run-make/readdir/Makefile @@ -7,6 +7,7 @@ check: $(objs) mkdir -p $(TMPDIR)/mnt/grow-buffer # 200 entries x 20 chars file name is enough to overflow the initial buffer @for i in $(shell seq 200); do touch "$(TMPDIR)/mnt/grow-buffer/dirent_with_long_name_$$i"; done + mkdir -p $(TMPDIR)/mnt/empty-dir wasmtime --mapdir /mnt::$(TMPDIR)/mnt $(TMPDIR)/main.wasm $(WASI_VFS_CLI) pack $(TMPDIR)/main.wasm --mapdir /mnt::$(TMPDIR)/mnt -o $(TMPDIR)/main.packed.wasm $(WASI_RUN) $(TMPDIR)/main.packed.wasm diff --git a/tests/run-make/readdir/main.c b/tests/run-make/readdir/main.c index 4d7cb1a..9562ed8 100644 --- a/tests/run-make/readdir/main.c +++ b/tests/run-make/readdir/main.c @@ -7,5 +7,6 @@ int main(int argc, char *argv[]) { // Check that pagination of readdir is working // 200 entries is enough to fill the initial readdir buffer check_dir_entry_size("/mnt/grow-buffer", 200); + check_dir_entry_size("/mnt/empty-dir", 0); return 0; }