10000 Fix broken tests on OS X · apfunk/libgit2sharp@1679067 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1679067

Browse files
committed
Fix broken tests on OS X
1 parent 94aeb13 commit 1679067

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

LibGit2Sharp.Tests/BranchFixture.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ public void CanCreateBranch(string name)
3030
Assert.Equal("refs/heads/" + name, newBranch.CanonicalName);
3131
Assert.NotNull(newBranch.Tip);
3232
Assert.Equal(committish, newBranch.Tip.Sha);
33-
Assert.NotNull(repo.Branches.SingleOrDefault(p => p.Name == name));
33+
34+
// Note the call to String.Normalize(). This is because, on Mac OS X, the filesystem
35+
// decomposes the UTF-8 characters on write, which results in a different set of bytes
36+
// when they're read back:
37+
// - from InlineData: C5-00-6E-00-67-00-73-00-74-00-72-00-F6-00-6D-00
38+
// - from filesystem: 41-00-0A-03-6E-00-67-00-73-00-74-00-72-00-6F-00-08-03-6D-00
39+
Assert.NotNull(repo.Branches.SingleOrDefault(p => p.Name.Normalize() == name));
3440

3541
AssertRefLogEntry(repo, newBranch.CanonicalName,
3642
newBranch.Tip.Id,

LibGit2Sharp.Tests/ConflictFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static IEnumerable<object[]> ConflictData
1313
{
1414
get
1515
{
16-
return new[]
16+
return new List<object[]>
1717
{
1818
new[] { "ancestor-and-ours.txt", "5dee68477001f447f50fa7ee7e6a818370b5c2fb", "dad0664ae617d36e464ec08ed969ff496432b075", null },
1919
new[] { "ancestor-and-theirs.txt", "3aafd4d0bac33cc3c78c4c070f3966fb6e6f641a", null, "7b26cd5ac0ee68483ae4d5e1e00b064547ea8c9b" },

LibGit2Sharp.Tests/ShadowCopyFixture.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public void CanProbeForNativeBinariesFromAShadowCopiedAssembly()
5151

5252
// ...but are currently loaded from different locations...
5353
string cachedAssemblyLocation = wrapper.AssemblyLocation;
54+
if (cachedAssemblyLocation.StartsWith("/private"))
55+
{
56+
// On OS X, sometimes you get /private/var/… instead of /var/…, but they map to the same place.
57+
cachedAssemblyLocation = cachedAssemblyLocation.Substring("/private".Length);
58+
}
5459
Assert.NotEqual(sourceAssembly.Location, cachedAssemblyLocation);
5560

5661
// ...that the assembly in the other domain is stored in the shadow copy cache...

0 commit comments

Comments
 (0)
0