Skip to content
This repository
Browse code

Added unit tests to ensure that quotepath support is working

  • Loading branch information...
commit d7c24b6a09f4b794fd409861a34a7b805427613d 1 parent da0bdaa
Rezun authored February 22, 2012

Showing 1 changed file with 32 additions and 0 deletions. Show diff stats Hide diff stats

  1. 32  GitTfsTest/Core/GitChangeInfoTests.cs
32  GitTfsTest/Core/GitChangeInfoTests.cs
@@ -41,6 +41,38 @@ public void GetsChangeTypeWhenScoreIsPresent()
41 41
             Assert.AreEqual("R", info.Status);
42 42
         }
43 43
 
  44
+        [TestMethod]
  45
+        public void GetsPath()
  46
+        {
  47
+            var line = ":000000 100644 abcdef0123abcdef0123abcdef0123abcdef0123 01234567ab01234567ab01234567ab01234567ab M\tFoo\tBar";
  48
+            var info = GitChangeInfo.Parse(line);
  49
+            Assert.AreEqual("Foo", info.path);
  50
+        }
  51
+
  52
+        [TestMethod]
  53
+        public void GetsPathTo()
  54
+        {
  55
+            var line = ":000000 100644 abcdef0123abcdef0123abcdef0123abcdef0123 01234567ab01234567ab01234567ab01234567ab M\tFoo\tBar";
  56
+            var info = GitChangeInfo.Parse(line);
  57
+            Assert.AreEqual("Bar", info.pathTo);
  58
+        }
  59
+
  60
+        [TestMethod]
  61
+        public void GetsPathWithQuotepath()
  62
+        {
  63
+            var line = ":000000 100644 abcdef0123abcdef0123abcdef0123abcdef0123 01234567ab01234567ab01234567ab01234567ab M\t\"\\366\"\t\"\\337\"";
  64
+            var info = GitChangeInfo.Parse(line);
  65
+            Assert.AreEqual("ö", info.path);
  66
+        }
  67
+
  68
+        [TestMethod]
  69
+        public void GetsPathToWithQuotepath()
  70
+        {
  71
+            var line = ":000000 100644 abcdef0123abcdef0123abcdef0123abcdef0123 01234567ab01234567ab01234567ab01234567ab M\t\"\\366\"\t\"\\337\"";
  72
+            var info = GitChangeInfo.Parse(line);
  73
+            Assert.AreEqual("ß", info.pathTo);
  74
+        }
  75
+
44 76
         private IGitChangedFile GetChangeItem(string diffTreeLine)
45 77
         {
46 78
             // This method is similar to BuildGitChangedFile in GitRepository.

0 notes on commit d7c24b6

Please sign in to comment.
Something went wrong with that request. Please try again.