changeset 4145:2ebdd33fe456

Add a test for the purge extension
author Emanuele Aina <faina.mail@tiscali.it>
date Tue, 06 Mar 2007 17:45:38 -0300
parents 03e9c22a6489
children e287d61dd268
files tests/test-purge tests/test-purge.out
diffstat 2 files changed, 93 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-purge	Tue Mar 06 17:45:38 2007 -0300
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+cat <<EOF >> $HGRCPATH
+[extensions]
+purge=${TESTDIR}/../contrib/purge/purge.py
+EOF
+
+echo % init
+hg init t
+cd t
+
+echo % setup
+echo r1 > r1
+hg ci -qAmr1 -d'0 0'
+mkdir directory
+echo r2 > directory/r2
+hg ci -qAmr2 -d'1 0'
+echo 'ignored' > .hgignore
+hg ci -qAmr3 -d'2 0'
+
+echo % delete an empty directory
+mkdir empty_dir
+hg purge -p
+hg purge -v
+ls
+
+echo % delete an untracked directory
+mkdir untracked_dir
+touch untracked_dir/untracked_file1
+touch untracked_dir/untracked_file2
+hg purge -p
+hg purge -v
+ls
+
+echo % delete an untracked file
+touch untracked_file
+hg purge -p
+hg purge -v
+ls
+
+echo % delete an untracked file in a tracked directory
+touch directory/untracked_file
+hg purge -p
+hg purge -v
+ls
+
+echo % delete nested directories
+mkdir -p untracked_directory/nested_directory
+hg purge -p
+hg purge -v
+ls
+
+echo % delete ignored files
+touch ignored
+hg purge -p
+hg purge -v
+ls
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-purge.out	Tue Mar 06 17:45:38 2007 -0300
@@ -0,0 +1,36 @@
+% init
+% setup
+% delete an empty directory
+empty_dir
+Removing directory empty_dir
+directory
+r1
+% delete an untracked directory
+untracked_dir/untracked_file1
+untracked_dir/untracked_file2
+Removing file untracked_dir/untracked_file1
+Removing file untracked_dir/untracked_file2
+Removing directory untracked_dir
+directory
+r1
+% delete an untracked file
+untracked_file
+Removing file untracked_file
+directory
+r1
+% delete an untracked file in a tracked directory
+directory/untracked_file
+Removing file directory/untracked_file
+directory
+r1
+% delete nested directories
+untracked_directory/nested_directory
+Removing directory untracked_directory/nested_directory
+Removing directory untracked_directory
+directory
+r1
+% delete ignored files
+ignored
+Removing file ignored
+directory
+r1