Patchwork [1,of,2] test-interactive: use stable EOL in various file generating routines

login
register
mail settings
Submitter Matt Harbison
Date March 24, 2015, 12:56 a.m.
Message ID <7d537b8ba43dbd798ec0.1427158602@Envy>
Download mbox | patch
Permalink /patch/8227/
State Accepted
Headers show

Comments

Matt Harbison - March 24, 2015, 12:56 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1426953403 14400
#      Sat Mar 21 11:56:43 2015 -0400
# Node ID 7d537b8ba43dbd798ec0ca0a244579729da8f478
# Parent  811a1842cfe5f632145912d9bf2dc859e6ee3eeb
test-interactive: use stable EOL in various file generating routines

The seq.py and shell echo redirected to a file ends up with platform specific
EOL, which throws off the hash when the file is committed to the test repo on
Windows.  The other option is to glob the hashes, but the ability to see if they
have changed might point out problems that would otherwise be missed.

Patch

diff --git a/tests/test-commit-interactive-curses.t b/tests/test-commit-interactive-curses.t
--- a/tests/test-commit-interactive-curses.t
+++ b/tests/test-commit-interactive-curses.t
@@ -45,7 +45,7 @@ 
 Committing only one file
 
   $ echo "a" >> a
-  $ python $TESTDIR/seq.py 1 10 > b
+  >>> open('b', 'wb').write("1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n")
   $ hg add b
   $ cat <<EOF >testModeCommands
   > TOGGLE
diff --git a/tests/test-revert-interactive.t b/tests/test-revert-interactive.t
--- a/tests/test-revert-interactive.t
+++ b/tests/test-revert-interactive.t
@@ -21,13 +21,17 @@ 
   $ mkdir -p a/folder1 a/folder2
   $ cd a
   $ hg init
-  $ python $TESTDIR/seq.py 1 5 > f ; hg add f ; hg commit -m "adding f"
+  >>> open('f', 'wb').write("1\n2\n3\n4\n5\n")
+  $ hg add f ; hg commit -m "adding f"
   $ cat f > folder1/g ; hg add folder1/g ; hg commit -m "adding folder1/g"
   $ cat f > folder2/h ; hg add folder2/h ; hg commit -m "adding folder2/h"
   $ cat f > folder1/i ; hg add folder1/i ; hg commit -m "adding folder1/i"
-  $ echo "a" > f ; python $TESTDIR/seq.py 1 5 >> f ; echo "b" >> f ; hg commit -m "modifying f"
-  $ echo "c" > folder1/g ; python $TESTDIR/seq.py 1 5 >> folder1/g ; echo "d" >> folder1/g ; hg commit -m "modifying folder1/g"
-  $ echo "e" > folder2/h ; python $TESTDIR/seq.py 1 5 >> folder2/h ; echo "f" >> folder2/h ; hg commit -m "modifying folder2/h"
+  >>> open('f', 'wb').write("a\n1\n2\n3\n4\n5\nb\n")
+  $ hg commit -m "modifying f"
+  >>> open('folder1/g', 'wb').write("c\n1\n2\n3\n4\n5\nd\n")
+  $ hg commit -m "modifying folder1/g"
+  >>> open('folder2/h', 'wb').write("e\n1\n2\n3\n4\n5\nf\n")
+  $ hg commit -m "modifying folder2/h"
   $ hg tip
   changeset:   6:59dd6e4ab63a
   tag:         tip