changeset 21:932e78684043

Add (failing) tests for apparent parser bugs (unhandled syntax). Remove reminder comment from test-fastimport-anonbranch.
author Greg Ward <greg-hg@gerg.ca>
date Sun, 03 May 2009 19:38:29 -0400
parents 1fd08644b5ac
children 3259eb19b39f
files tests/test-fastimport-anonbranch tests/test-fastimport-syntax
diffstat 2 files changed, 57 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-fastimport-anonbranch	Sat May 02 18:08:56 2009 -0400
+++ b/tests/test-fastimport-anonbranch	Sun May 03 19:38:29 2009 -0400
@@ -101,12 +101,8 @@
 data 10
 blah blah
 
-
 __EOF__
 
-# XXX crash if blank line after "merge" command missing, but
-# git-fast-import(1) says it's optional
-
 set -e
 echo "% import"
 rm -rf anonbranch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-fastimport-syntax	Sun May 03 19:38:29 2009 -0400
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# Probe the corners of fastimport syntax to make sure our
+# parser is up to scratch.
+
+. $TESTDIR/fastimport-common
+
+echo "% dump with no newline after merge commit"
+cat > test1.dump <<__EOF__
+# rev 0
+commit refs/heads/master
+mark :1
+committer Example <example@example.org> 1200000000 +0000
+data 0
+
+# rev 1
+commit refs/heads/master
+mark :2
+committer Example <example@example.org> 1200000001 +0000
+data 0
+
+# rev 2 (merge 0 + 1)
+commit refs/heads/master
+mark :3
+committer Example <example@example.org> 1200000002 +0000
+data 0
+from :1
+merge :2
+__EOF__
+
+hg init test1
+cd test1
+hg fastimport ../test1.dump
+hg glog --template "{rev}:{node|short}\n{desc}\n\n"
+cd ..
+
+echo "% dump with redundant 'from' directive"
+cat > test2.dump <<__EOF__
+# rev 0
+commit refs/heads/master
+mark :1
+committer Example <example@example.org> 1200000000 +0000
+data 0
+
+# rev 1
+commit refs/heads/master
+mark :2
+committer Example <example@example.org> 1200000001 +0000
+data 0
+from :1
+
+__EOF__
+
+hg init test2
+cd test2
+hg fastimport ../test2.dump
+hg glog --template "{rev}:{node|short}\n{desc}\n\n"