Skip to content

Commit 54cb451

Browse files
committed
Ignore line ending differences (part 6)
1 parent 382b7ff commit 54cb451

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/Carbon.Css.Tests/CssColorTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public void CanParseRgb()
4242
}
4343
}
4444

45-
4645
// color(rec2020 0.42053 0.979780 0.00579)
4746

4847
// color(display-p3 34% 58% 73%)

src/Carbon.Css.Tests/CssTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void EnsureFlushBehavior()
2121

2222
writer.Flush();
2323

24-
Assert.Equal(27, output.Length);
24+
Assert.Equal(23 + (Environment.NewLine.Length * 2), output.Length);
2525
}
2626

2727
[Fact]
@@ -325,8 +325,7 @@ public void Transitions()
325325
-webkit-transition: width 1s;
326326
transition: width 1s;
327327
}
328-
""",
329-
actual: sheet.ToString()
328+
""".ReplaceLineEndings(Environment.NewLine), sheet.ToString()
330329
);
331330
}
332331

@@ -587,21 +586,21 @@ public void Parse11()
587586
:focus {
588587
outline: 0;
589588
}
590-
""", StyleSheet.Parse(":focus { outline:0; }").ToString());
589+
""".ReplaceLineEndings(Environment.NewLine), StyleSheet.Parse(":focus { outline:0; }").ToString());
591590

592591
Assert.Equal(
593592
"""
594593
.projects li:first-child {
595594
background-color: orange;
596595
}
597-
""", StyleSheet.Parse(".projects li:first-child { background-color: orange; }").ToString(), ignoreLineEndingDifferences: true);
596+
""".ReplaceLineEndings(Environment.NewLine), StyleSheet.Parse(".projects li:first-child { background-color: orange; }").ToString(), ignoreLineEndingDifferences: true);
598597

599598
Assert.Equal(
600599
"""
601600
.projects li:first-child a {
602601
background-color: orange;
603602
}
604-
""", StyleSheet.Parse(".projects li:first-child a { background-color: orange; }").ToString(), ignoreLineEndingDifferences: true);
603+
""".ReplaceLineEndings(Environment.NewLine), StyleSheet.Parse(".projects li:first-child a { background-color: orange; }").ToString(), ignoreLineEndingDifferences: true);
605604
}
606605

607606
[Fact]

src/Carbon.Css.Tests/ResolverTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class ResolverTests
66
public void A()
77
{
88
var text = File.ReadAllText(TestHelper.GetTestFile("webcat/all.scss").FullName);
9-
var expected = File.ReadAllText(TestHelper.GetTestFile("webcat/expected.txt").FullName);
9+
var expected = File.ReadAllText(TestHelper.GetTestFile("webcat/expected.txt").FullName).ReplaceLineEndings(Environment.NewLine);
1010

1111
var sheet = StyleSheet.Parse(text, new CssContext());
1212

0 commit comments

Comments
 (0)