Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed tests failing you check out with \n on windows. #41

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
}
}
}
Loading