diff options
author | Keith Dahlby <dahlbyk@gmail.com> | 2013-10-24 23:21:17 +0400 |
---|---|---|
committer | Keith Dahlby <dahlbyk@gmail.com> | 2013-11-03 21:09:37 +0400 |
commit | af112891809fddb14705cb751f5217ee6b9cd990 (patch) | |
tree | 48999c6a2a1f2203dda8157f9205bc5959297a59 /LibGit2Sharp.Tests | |
parent | 0c4780b5fbe186fcda1337de808a74753dac2041 (diff) |
Check autocrlf in filtered text test
Diffstat (limited to 'LibGit2Sharp.Tests')
-rw-r--r-- | LibGit2Sharp.Tests/BlobFixture.cs | 25 |
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); } } |