Permalink
Browse files

Added unit tests to ensure that quotepath support is working

  • Loading branch information...
rezun committed Feb 22, 2012
1 parent da0bdaa commit d7c24b6a09f4b794fd409861a34a7b805427613d
Showing with 32 additions and 0 deletions.
  1. +32 −0 GitTfsTest/Core/GitChangeInfoTests.cs
@@ -41,6 +41,38 @@ public void GetsChangeTypeWhenScoreIsPresent()
Assert.AreEqual("R", info.Status);
}
+ [TestMethod]
+ public void GetsPath()
+ {
+ var line = ":000000 100644 abcdef0123abcdef0123abcdef0123abcdef0123 01234567ab01234567ab01234567ab01234567ab M\tFoo\tBar";
+ var info = GitChangeInfo.Parse(line);
+ Assert.AreEqual("Foo", info.path);
+ }
+
+ [TestMethod]
+ public void GetsPathTo()
+ {
+ var line = ":000000 100644 abcdef0123abcdef0123abcdef0123abcdef0123 01234567ab01234567ab01234567ab01234567ab M\tFoo\tBar";
+ var info = GitChangeInfo.Parse(line);
+ Assert.AreEqual("Bar", info.pathTo);
+ }
+
+ [TestMethod]
+ public void GetsPathWithQuotepath()
+ {
+ var line = ":000000 100644 abcdef0123abcdef0123abcdef0123abcdef0123 01234567ab01234567ab01234567ab01234567ab M\t\"\\366\"\t\"\\337\"";
+ var info = GitChangeInfo.Parse(line);
+ Assert.AreEqual("ö", info.path);
+ }
+
+ [TestMethod]
+ public void GetsPathToWithQuotepath()
+ {
+ var line = ":000000 100644 abcdef0123abcdef0123abcdef0123abcdef0123 01234567ab01234567ab01234567ab01234567ab M\t\"\\366\"\t\"\\337\"";
+ var info = GitChangeInfo.Parse(line);
+ Assert.AreEqual("ß", info.pathTo);
+ }
+
private IGitChangedFile GetChangeItem(string diffTreeLine)
{
// This method is similar to BuildGitChangedFile in GitRepository.

0 comments on commit d7c24b6

Please sign in to comment.