# HG changeset patch # User Thomas Arendsen Hein # Date 1125422225 -7200 # Node ID bd66294b7a9bcc85f020a50a1170f12839e666ed # Parent 04be5eb73bb3371952a3befafb211cab3386352b Added test case for zip/gz/bz2 archive downloads. diff --git a/tests/test-archive b/tests/test-archive new file mode 100755 --- /dev/null +++ b/tests/test-archive @@ -0,0 +1,37 @@ +#!/bin/sh + +mkdir test +cd test +hg init +echo foo>foo +hg addremove +hg commit -m 1 +echo bar>bar +hg addremove +hg commit -m 2 +mkdir baz +echo bletch>baz/bletch +hg addremove +hg commit -m 3 +echo "name = test-archive" >> .hg/hgrc +echo "allowzip = true" >> .hg/hgrc +echo "allowgz = true" >> .hg/hgrc +echo "allowbz2 = true" >> .hg/hgrc +hg serve -p 20059 > /dev/null & +sleep 1 # wait for server to be started + +TIP=`hg id -v | cut -f1 -d' '` +QTIP=`hg id -q` +cat > getarchive.py < archive.zip +unzip -t archive.zip | sed "s/$QTIP/TIP/" + +kill $! diff --git a/tests/test-archive.out b/tests/test-archive.out new file mode 100644 --- /dev/null +++ b/tests/test-archive.out @@ -0,0 +1,15 @@ +adding foo +adding bar +adding baz/bletch +test-archive-TIP/bar +test-archive-TIP/baz/bletch +test-archive-TIP/foo +test-archive-TIP/bar +test-archive-TIP/baz/bletch +test-archive-TIP/foo +Archive: archive.zip + testing: test-archive-TIP/bar OK + testing: test-archive-TIP/baz/bletch OK + testing: test-archive-TIP/foo OK +No errors detected in compressed data of archive.zip. +killed!