test-context: add test for memctx status
authorSean Farley <sean.michael.farley@gmail.com>
Fri, 13 Jun 2014 15:56:11 -0700
changeset 21836 232038a05fdb
parent 21835 b342c3e2518a
child 21837 61b333b982ea
test-context: add test for memctx status
tests/test-context.py
tests/test-context.py.out
--- a/tests/test-context.py	Thu May 29 16:12:59 2014 -0500
+++ b/tests/test-context.py	Fri Jun 13 15:56:11 2014 -0700
@@ -30,3 +30,19 @@
 for enc in "ASCII", "Latin-1", "UTF-8":
     encoding.encoding = enc
     print "%-8s: %s" % (enc, repo["tip"].description())
+
+# test performing a status
+
+def getfilectx(repo, memctx, f):
+    fctx = memctx.parents()[0][f]
+    data, flags = fctx.data(), fctx.flags()
+    if f == 'foo':
+        data += 'bar\n'
+    return context.memfilectx(repo, f, data, 'l' in flags, 'x' in flags)
+
+ctxa = repo.changectx(0)
+ctxb = context.memctx(repo, [ctxa.node(), None],
+                      "test diff",
+                      ["foo"], getfilectx)
+
+print ctxb.status(ctxa)
--- a/tests/test-context.py.out	Thu May 29 16:12:59 2014 -0500
+++ b/tests/test-context.py.out	Fri Jun 13 15:56:11 2014 -0700
@@ -2,3 +2,4 @@
 ASCII   : Gr?ezi!
 Latin-1 : Grüezi!
 UTF-8   : Grüezi!
+(['foo'], [], [], [], [], [], [])