Test for the awesome let's-silently-overwrite-local-files bug.
authornicm <nicm@openbsd.org>
Tue, 13 Jul 2010 21:31:17 +0000 (21:31 +0000)
committernicm <nicm@openbsd.org>
Tue, 13 Jul 2010 21:31:17 +0000 (21:31 +0000)
regress/usr.bin/cvs/Makefile

index 96e2081..7fb78d2 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.27 2010/07/13 20:47:56 nicm Exp $
+#      $OpenBSD: Makefile,v 1.28 2010/07/13 21:31:17 nicm Exp $
 
 # Regression tests by Niall O'Higgins <niallo@openbsd.org> and
 # Tobias Stoeckmann <tobias@openbsd.org>.
@@ -66,7 +66,7 @@ LTESTS= cvs-initial \
        cvs-rlog \
        cvs-rtag-one_more_branch \
        cvs-export \
-       cvs-merge
+       cvs-update-with-local
 # Known to fail.
 #      cvs-update-for_subdir
 #      cvs-release-dflag
@@ -320,6 +320,22 @@ test-cvs-merge:
        @echo "modified text" > ${REGRESS_WCOPY}/b/seed/seed1.txt
        @cd ${REGRESS_WCOPY}/b/seed && test `${CVSCMD} -q up | wc -l` -eq 0
 
+test-cvs-update-with-local:
+       @rm -rf ${REGRESS_WCOPY}
+       @mkdir -p ${REGRESS_WCOPY}/a ${REGRESS_WCOPY}/b
+       @cd ${REGRESS_WCOPY}/a; \
+           ${CVSCMD} -Q -d ${MYCVSROOT} co seed > /dev/null
+       @cd ${REGRESS_WCOPY}/b; \
+           ${CVSCMD} -Q -d ${MYCVSROOT} co seed > /dev/null
+       @echo "new file" > ${REGRESS_WCOPY}/a/seed/test.txt
+       @cd ${REGRESS_WCOPY}/a/seed && \
+               ${CVSCMD} -Q add test.txt > /dev/null && \
+               ${CVSCMD} -Q com -m 'a' > /dev/null; 
+       @echo "local file" > ${REGRESS_WCOPY}/b/seed/test.txt
+       @cd ${REGRESS_WCOPY}/b/seed && \
+               ${CVSCMD} -Q up 2>&1|grep -q '^C test.txt' && \
+               grep -q '^local file' test.txt
+
 clean:
        @rm -rf ${CLEANFILES}