Skip to content

Commit

Permalink
fix: Fixed tests failing you check out with \n on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
ITR13 committed May 10, 2024
1 parent e389187 commit 9ba37b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Tomlet.Tests/CommentSerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void CommentsOnTablesWork()
[table] # This is an inline comment
key = ""value"" # Inline comment on value";

Assert.Equal(expected, doc.SerializedValue.Trim().ReplaceLineEndings());
Assert.Equal(expected.ReplaceLineEndings(), doc.SerializedValue.Trim().ReplaceLineEndings());
}

[Fact]
Expand Down Expand Up @@ -84,7 +84,7 @@ public void CommentsOnTableArraysWork()
[[table-array]] # This is an inline comment on the table
key = ""value"" # Inline comment on value".Trim();

Assert.Equal(expected, doc.SerializedValue.Trim().ReplaceLineEndings());
Assert.Equal(expected.ReplaceLineEndings(), doc.SerializedValue.Trim().ReplaceLineEndings());
}

[Fact]
Expand All @@ -102,7 +102,7 @@ public void CommentsOnPrimitiveArraysWork()
1,
2, # This is an inline comment on the second value of the array
3,
]";
]".ReplaceLineEndings();

//Replace tabs with spaces because this source file uses spaces
var actual = doc.SerializedValue.Trim().Replace("\t", " ").ReplaceLineEndings();
Expand Down
4 changes: 2 additions & 2 deletions Tomlet.Tests/ObjectToTomlDocTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public void SerializationRecptsOverridingFieldsUsingNewKeyword()
var expectedResult = @"OverwrittenField = ""this should be overwritten, not 'default value' as set in superclass.""
NotOverwrittenSubclassField = ""this is a non-overwritten field, defined only in the subclass.""
NotOverwrittenSuperclassField = ""this is a non-overwritten field, defined only in the superclass.""
".Replace("\r", "");
";

var tomlDoc = TomletMain.DocumentFrom(testObject);

Assert.Equal(expectedResult, tomlDoc.SerializedValue);
Assert.Equal(expectedResult.ReplaceLineEndings(), tomlDoc.SerializedValue.ReplaceLineEndings());
}

[Fact]
Expand Down
4 changes: 2 additions & 2 deletions Tomlet.Tests/TomlTableArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void TableArraySerializationWorks()
[[array]]
name = ""a""
value = { a = ""b"", c = ""d"" }
".Trim();
".Trim().ReplaceLineEndings();

Assert.Equal(expectedResult, tomlString);
}
Expand Down Expand Up @@ -146,7 +146,7 @@ public void TablesWithNestedArraysHaveCorrectWhitespace()
[[Root.Array]]
A = ""C""
B = ""D""", str.Trim().ReplaceLineEndings());
B = ""D""".ReplaceLineEndings(), str.Trim().ReplaceLineEndings());
}
}
}

0 comments on commit 9ba37b7

Please sign in to comment.