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:
authorKeith Dahlby <dahlbyk@gmail.com>2013-10-24 23:21:17 +0400
committerKeith Dahlby <dahlbyk@gmail.com>2013-11-03 21:09:37 +0400
commitaf112891809fddb14705cb751f5217ee6b9cd990 (patch)
tree48999c6a2a1f2203dda8157f9205bc5959297a59 /LibGit2Sharp.Tests
parent0c4780b5fbe186fcda1337de808a74753dac2041 (diff)
Check autocrlf in filtered text test
Diffstat (limited to 'LibGit2Sharp.Tests')
-rw-r--r--LibGit2Sharp.Tests/BlobFixture.cs25
1 files changed, 12 insertions, 13 deletions
diff --git a/LibGit2Sharp.Tests/BlobFixture.cs b/LibGit2Sharp.Tests/BlobFixture.cs
index cc9d2041..24f5d0b7 100644
--- a/LibGit2Sharp.Tests/BlobFixture.cs
+++ b/LibGit2Sharp.Tests/BlobFixture.cs
@@ -23,25 +23,24 @@ namespace LibGit2Sharp.Tests
}
}
- [Fact]
- public void CanGetBlobAsFilteredText()
+ [SkippableTheory]
+ [InlineData("false", "hey there\n")]
+ [InlineData("input", "hey there\n")]
+ [InlineData("true", "hey there\r\n")]
+ public void CanGetBlobAsFilteredText(string autocrlf, string expectedText)
{
- using (var repo = new Repository(BareTestRepoPath))
+ SkipIfNotSupported(autocrlf);
+
+ var path = CloneBareTestRepo();
+ using (var repo = new Repository(path))
{
+ repo.Config.Set("core.autocrlf", autocrlf);
+
var blob = repo.Lookup<Blob>("a8233120f6ad708f843d861ce2b7228ec4e3dec6");
var text = blob.GetContentText(new FilteringOptions("foo.txt"));
- ConfigurationEntry<bool> autocrlf = repo.Config.Get<bool>("core.autocrlf");
-
- if (autocrlf != null && autocrlf.Value)
- {
- Assert.Equal("hey there\r\n", text);
- }
- else
- {
- Assert.Equal("hey there\n", text);
- }
+ Assert.Equal(expectedText, text);
}
}