Skip to content

Commit

Permalink
test: ensure that empty directory is packed into embededfs
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Aug 26, 2022
1 parent bdf41ac commit 8067811
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/run-make/readdir/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/run-make/readdir/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 8067811

Please sign in to comment.