Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-11-11 20:42:26 +0400
committerBen Straub <bs@github.com>2013-11-11 20:54:39 +0400
commit1679067e35348335130e6c7a206f497e1c378d73 (patch)
tree7ddd35a21f05259c8373620664c37c81ddfc4474 /LibGit2Sharp.Tests
parent94aeb13043c31246348ecb399639c7779410d807 (diff)
Fix broken tests on OS X
Diffstat (limited to 'LibGit2Sharp.Tests')
-rw-r--r--LibGit2Sharp.Tests/BranchFixture.cs8
-rw-r--r--LibGit2Sharp.Tests/ConflictFixture.cs2
-rw-r--r--LibGit2Sharp.Tests/ShadowCopyFixture.cs5
3 files changed, 13 insertions, 2 deletions
diff --git a/LibGit2Sharp.Tests/BranchFixture.cs b/LibGit2Sharp.Tests/BranchFixture.cs
index a6fcc300..63fcced7 100644
--- a/LibGit2Sharp.Tests/BranchFixture.cs
+++ b/LibGit2Sharp.Tests/BranchFixture.cs
@@ -30,7 +30,13 @@ namespace LibGit2Sharp.Tests
Assert.Equal("refs/heads/" + name, newBranch.CanonicalName);
Assert.NotNull(newBranch.Tip);
Assert.Equal(committish, newBranch.Tip.Sha);
- Assert.NotNull(repo.Branches.SingleOrDefault(p => p.Name == name));
+
+ // Note the call to String.Normalize(). This is because, on Mac OS X, the filesystem
+ // decomposes the UTF-8 characters on write, which results in a different set of bytes
+ // when they're read back:
+ // - from InlineData: C5-00-6E-00-67-00-73-00-74-00-72-00-F6-00-6D-00
+ // - from filesystem: 41-00-0A-03-6E-00-67-00-73-00-74-00-72-00-6F-00-08-03-6D-00
+ Assert.NotNull(repo.Branches.SingleOrDefault(p => p.Name.Normalize() == name));
AssertRefLogEntry(repo, newBranch.CanonicalName,
newBranch.Tip.Id,
diff --git a/LibGit2Sharp.Tests/ConflictFixture.cs b/LibGit2Sharp.Tests/ConflictFixture.cs
index 5e6c3e7d..deec945c 100644
--- a/LibGit2Sharp.Tests/ConflictFixture.cs
+++ b/LibGit2Sharp.Tests/ConflictFixture.cs
@@ -13,7 +13,7 @@ namespace LibGit2Sharp.Tests
{
get
{
- return new[]
+ return new List<object[]>
{
new[] { "ancestor-and-ours.txt", "5dee68477001f447f50fa7ee7e6a818370b5c2fb", "dad0664ae617d36e464ec08ed969ff496432b075", null },
new[] { "ancestor-and-theirs.txt", "3aafd4d0bac33cc3c78c4c070f3966fb6e6f641a", null, "7b26cd5ac0ee68483ae4d5e1e00b064547ea8c9b" },
diff --git a/LibGit2Sharp.Tests/ShadowCopyFixture.cs b/LibGit2Sharp.Tests/ShadowCopyFixture.cs
index 3264b118..c5336685 100644
--- a/LibGit2Sharp.Tests/ShadowCopyFixture.cs
+++ b/LibGit2Sharp.Tests/ShadowCopyFixture.cs
@@ -51,6 +51,11 @@ namespace LibGit2Sharp.Tests
// ...but are currently loaded from different locations...
string cachedAssemblyLocation = wrapper.AssemblyLocation;
+ if (cachedAssemblyLocation.StartsWith("/private"))
+ {
+ // On OS X, sometimes you get /private/var/… instead of /var/…, but they map to the same place.
+ cachedAssemblyLocation = cachedAssemblyLocation.Substring("/private".Length);
+ }
Assert.NotEqual(sourceAssembly.Location, cachedAssemblyLocation);
// ...that the assembly in the other domain is stored in the shadow copy cache...