[PATCH 2 of 2] tests: ensure run-tests handles multiple lines of churn

timeless timeless at mozdev.org
Mon Mar 21 17:13:50 EDT 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1458593806 0
#      Mon Mar 21 20:56:46 2016 +0000
# Node ID 3ab81f2dc0dfedbc98f4704959b376f6b5431486
# Parent  d104b8e4e18c6f98267ec4bbc2bb4957e2571eeb
tests: ensure run-tests handles multiple lines of churn

1ad0ddf8cccc added the ability to remember lines (including their flags, like glob)
and tolerate them even if the output order varies.

This test ensures that the code will continue to work in the future.

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -67,6 +67,30 @@
 failing test
 ==================
 
+test churn with globs
+  $ cat > test-failure.t <<EOF
+  >   $ echo "bar/baz"; echo "bar/bad"
+  >   bar/bad (glob)
+  >   bar/baz (glob)
+  > EOF
+  $ rt test-failure.t
+  
+  --- $TESTTMP/test-failure.t
+  +++ $TESTTMP/test-failure.t.err
+  @@ -1,3 +1,3 @@
+     $ echo "bar/baz"; echo "bar/bad"
+  +  bar/baz (glob)
+     bar/bad (glob)
+  -  bar/baz (glob)
+  
+  ERROR: test-failure.t output changed
+  !
+  Failed test-failure.t: output changed
+  # Ran 1 tests, 0 skipped, 0 warned, 1 failed.
+  python hash seed: * (glob)
+  [1]
+
+basic failing test
   $ cat > test-failure.t << EOF
   >   $ echo babar
   >   rataxes


More information about the Mercurial-devel mailing list