Patchwork [4,of,4] schemas: add tests to cover schema transmission

login
register
mail settings
Submitter Durham Goode
Date Aug. 7, 2013, 12:28 a.m.
Message ID <30ed64131bf76a55ed9d.1375835309@dev350.prn1.facebook.com>
Download mbox | patch
Permalink /patch/2014/
State Changes Requested
Headers show

Comments

Durham Goode - Aug. 7, 2013, 12:28 a.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1375827639 25200
#      Tue Aug 06 15:20:39 2013 -0700
# Node ID 30ed64131bf76a55ed9dbc6e4aebf4c90f413624
# Parent  693af582853bc61a1fee181d047e944fa93da490
schemas: add tests to cover schema transmission

Adds tests for how schema transmission happens during clone and pull.

Patch

diff --git a/tests/test-schemas.t b/tests/test-schemas.t
new file mode 100644
--- /dev/null
+++ b/tests/test-schemas.t
@@ -0,0 +1,43 @@ 
+  $ hg init one
+  $ cd one
+
+  $ echo a > a
+  $ hg add a
+  $ hg commit -ma
+  $ echo "test test:foo" >> .hg/schemas
+  $ cd ..
+
+# Schemas are transmitted on clone
+
+  $ hg clone -q one two
+  $ cd two
+  $ cat .hg/schemas
+  test test:foo
+
+# Schemas are updated on pull
+
+  $ echo "test2 test:bar" >> ../one/.hg/schemas
+  $ hg pull -q
+  $ cat .hg/schemas
+  test test:foo
+  test2 test:bar
+
+# Existing schemas are not deleted if remote doesn't have them
+
+  $ echo "test3 test:zoo" > ../one/.hg/schemas
+  $ hg pull -q
+  $ cat .hg/schemas
+  test test:foo
+  test3 test:zoo
+  test2 test:bar
+
+# Empty schema is ok
+
+  $ rm ../one/.hg/schemas
+  $ hg pull -q
+  $ cat .hg/schemas
+  test test:foo
+  test3 test:zoo
+  test2 test:bar
+
+  $ cd ..