Skip to content

Commit

Permalink
Merge pull request #35 from 0xced/normalize-line-endings
Browse files Browse the repository at this point in the history
Normalize line endings for tests which are sensitive to line ending
  • Loading branch information
xoofx committed May 9, 2022
2 parents 9d6ebf3 + 4e4bda4 commit e16e8aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Tomlyn.Tests/ModelTests/ReflectionModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ public void TestCommentRoundtripWithModel()
[[array]] # a comment after a table array
key2 = 3
# This is a comment after a key
";
".ReplaceLineEndings();

StandardTests.DisplayHeader("input");
Console.WriteLine(input);
var model = Toml.ToModel(input);
Expand Down
3 changes: 2 additions & 1 deletion src/Tomlyn.Tests/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the BSD-Clause 2 license.
// See license.txt file in the project root for full license information.

using System;
using NUnit.Framework;
using Tomlyn.Model;

Expand All @@ -23,7 +24,7 @@ public void TestCrlfInMultilineString()

model["property"] = "string\r\nwith\r\nnewlines";

Assert.AreEqual("property = '''string\r\nwith\r\nnewlines'''\r\n", Toml.FromModel(model));
Assert.AreEqual("property = '''string\r\nwith\r\nnewlines'''" + Environment.NewLine, Toml.FromModel(model));
}
}
}
3 changes: 2 additions & 1 deletion src/Tomlyn.Tests/TomlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public void TestDescendants()
test.sub.key = ""yes""
[[array]]
hello = true
";
".ReplaceLineEndings("\r\n");

var tokens = Toml.Parse(input).Tokens().ToList();
var builder = new StringBuilder();
foreach (var node in tokens)
Expand Down

0 comments on commit e16e8aa

Please sign in to comment.