Skip to content

Commit

Permalink
[ test ] Make cat-many test to report more on what's going on
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden committed Jul 31, 2024
1 parent 9119d6e commit c762060
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/file/cat-many-files/run
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
rm -rf build
rm -rf to-cat to-swirl

die() {
echo "failed after $1"
test -r to-swirl && (echo "beginning of 'to-swirl':"; head -n 10 to-swirl)
test -r to-cat && (echo "beginning of 'to-cat':"; head -n 10 to-cat)
exit "$1"
}

flock "$1" pack -q install-deps test.ipkg || die 1

FILES="$(pack package-path | tr ':' '\n' | while read r; do find "$r" -type f -name '*.idr'; done | sed '/ /d')"
FILES="$(pack package-path | tr ':' '\n' | while read -r r; do find "$r" -type f -name '*.idr'; done | sed '/ /d')" || die 2

flock "$1" pack -q install-deps test.ipkg && \
pack run test.ipkg $FILES > to-swirl && \
cat $FILES > to-cat
pack run test.ipkg $FILES > to-swirl || die 3
cat $FILES > to-cat || die 4

# TODO to think maybe create `to-*` files in a temp file system

Expand Down

0 comments on commit c762060

Please sign in to comment.