tests/test-status
changeset 6200 acc40572da5b
parent 6033 a1ebd5cd7e55
child 6201 305d4450036a
--- a/tests/test-status	Fri Feb 29 14:48:21 2008 -0800
+++ b/tests/test-status	Sat Mar 01 22:30:03 2008 +0100
@@ -44,3 +44,51 @@
 hg status ignoreddir/file
 echo "hg status -i ignoreddir/file:"
 hg status -i ignoreddir/file
+cd ..
+
+# check 'status -q' and some combinations
+hg init repo3
+cd repo3
+touch modified removed deleted ignored
+echo "^ignored$" > .hgignore
+hg commit -A -m 'initial checkin'
+touch added unknown ignored
+hg add added
+echo "test" >> modified
+hg remove removed
+rm deleted
+hg copy modified copied
+
+# Run status with 2 different flags.
+# Check if result is the same or different.
+# If result is not as expected, raise error
+function assert {
+    hg status $1 > ../a
+    hg status $2 > ../b
+    out=`diff ../a ../b`
+    if [ $? -ne 0 ]; then
+        out=1
+    else
+        out=0
+    fi
+    if [ $3 -eq 0 ]; then
+        df="same"
+    else
+        df="different"
+    fi
+    if [ $out -ne $3 ]; then
+        echo "Error on $1 and $2, should be $df."
+    fi
+}
+
+# assert flag1 flag2 [0-same | 1-different]
+assert "-q" "-mard"     0
+assert "-A" "-mardicCu" 0
+assert "-qA" "-mardicCu" 0
+assert "-qAu" "-A"      0
+assert "-qA" "-A"       0
+assert "-qu" "-u"       0
+assert "-q" "-u"        1
+assert "-m" "-a"        1
+assert "-r" "-d"        1
+