Skip to content

Commit a652e4f

Browse files
committed
Ignore line ending differences (part 2)
1 parent ba21d86 commit a652e4f

File tree

10 files changed

+35
-38
lines changed

10 files changed

+35
-38
lines changed

src/Carbon.Css.Tests/ColorTests.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public void RgbaTest()
1212
div {
1313
color: rgba(100, 100, 100, 0.5);
1414
}
15-
""", sheet.ToString());
15+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
1616
}
1717

1818
[Fact]
@@ -27,7 +27,7 @@ public void Q()
2727

2828
var sheet = StyleSheet.Parse(text);
2929

30-
Assert.Equal(text, sheet.ToString());
30+
Assert.Equal(text, sheet.ToString(), ignoreLineEndingDifferences: true);
3131
}
3232

3333
[Fact]
@@ -53,7 +53,7 @@ public void Rgba1()
5353
div {
5454
color: rgb(255, 255, 255, 0.5);
5555
}
56-
""", sheet.ToString());
56+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
5757
}
5858

5959
[Fact]
@@ -66,7 +66,7 @@ public void Rgba2()
6666
div {
6767
color: rgb(255 255 255 / 50%);
6868
}
69-
""", sheet.ToString());
69+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
7070
}
7171

7272
[Fact]
@@ -81,7 +81,7 @@ public void HexA()
8181
body {
8282
background-color: #ffffff80;
8383
}
84-
""", value.ToString());
84+
""", value.ToString(), ignoreLineEndingDifferences: true);
8585
}
8686

8787
[Fact]
@@ -94,10 +94,9 @@ public void Rgba3()
9494
div {
9595
color: #7482974f;
9696
}
97-
""", sheet.ToString());
97+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
9898
}
9999

100-
101100
[Fact]
102101
public void Hsl1()
103102
{
@@ -108,7 +107,7 @@ public void Hsl1()
108107
div {
109108
color: hsl(11, 100%, 50%);
110109
}
111-
""", sheet.ToString());
110+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
112111
}
113112

114113
[Fact]
@@ -138,7 +137,7 @@ public void LinearGradient()
138137
div {
139138
background: linear-gradient(0deg, rgb(29 30 40 / 0%) 0%, red 94%);
140139
}
141-
""", s1.ToString());
140+
""", s1.ToString(), ignoreLineEndingDifferences: true);
142141
}
143142

144143
[Fact]
@@ -151,7 +150,7 @@ public void NestedRgb()
151150
div {
152151
color: #0203044c;
153152
}
154-
""", s1.ToString());
153+
""", s1.ToString(), ignoreLineEndingDifferences: true);
155154
}
156155
}
157156

src/Carbon.Css.Tests/CssFunctionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public void Unquote()
1717
div {
1818
padding: calc((100% - 600px) / 2);
1919
}
20-
""", sheet.ToString());
20+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
2121
}
2222

2323
[Fact]
@@ -30,6 +30,6 @@ public void ParseFunctionWithLeadingWhitespaceInArgument()
3030
div {
3131
background-color: rgba(42, 45, 53, 0.7);
3232
}
33-
""", sheet.ToString());
33+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
3434
}
3535
}

src/Carbon.Css.Tests/CssTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ @media only screen and (min-width : 1600px) {
282282
margin: 0 auto;
283283
}
284284
}
285-
""", css.ToString());
285+
""", css.ToString(), ignoreLineEndingDifferences: true);
286286
}
287287

288288
[Fact]
@@ -354,7 +354,7 @@ public void LineComment()
354354
hi {
355355
hello: test;
356356
}
357-
""", sheet.ToString());
357+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
358358
}
359359

360360
[Fact]
@@ -412,7 +412,7 @@ public void CalcTest()
412412
margin: 0.5in;
413413
width: calc(100% / 3 - 2 * 1em - 2 * 1px);
414414
}
415-
""", sheet.ToString());
415+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
416416
}
417417

418418
[Fact]
@@ -432,7 +432,7 @@ public void GitIssue2()
432432
.someClass {
433433
font-size: 1.2rem;
434434
}
435-
""", sheet.ToString());
435+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
436436
}
437437

438438
[Fact]
@@ -498,7 +498,7 @@ public void FontFace()
498498
font-weight: normal;
499499
font-style: normal;
500500
}
501-
""", sheet.ToString());
501+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
502502

503503
// Test 2
504504
StyleSheet.Parse(

src/Carbon.Css.Tests/IsTests.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void Q1()
2525
body:has(mymind-lightbox > .intro-video) mymind-lightbox-close-bar {
2626
display: none !important;
2727
}
28-
""", css.ToString());
28+
""", css.ToString(), ignoreLineEndingDifferences: true);
2929
}
3030

3131
[Fact]
@@ -46,7 +46,7 @@ public void Q()
4646
body:has(mymind-lightbox-close-bar:hover) mymind-backdrop {
4747
opacity: 0.8 !important;
4848
}
49-
""", css.ToString());
49+
""", css.ToString(), ignoreLineEndingDifferences: true);
5050
}
5151

5252
[Theory]
@@ -70,9 +70,8 @@ public void NotTests(string selector)
7070
p:not({{selector}}) {
7171
font-weight: bold;
7272
}
73-
""", css.ToString());
73+
""", css.ToString(), ignoreLineEndingDifferences: true);
7474
}
75-
7675

7776
[Fact]
7877
public void WhereTests()
@@ -90,7 +89,7 @@ public void WhereTests()
9089
:where(ol, ul, menu:unsupported) :where(ol, ul) {
9190
color: green;
9291
}
93-
""", css.ToString());
92+
""", css.ToString(), ignoreLineEndingDifferences: true);
9493
}
9594

9695
[Fact]
@@ -110,7 +109,7 @@ public void A()
110109
border-radius: 4px;
111110
padding: 8px 12px;
112111
}
113-
""", css.ToString());
112+
""", css.ToString(), ignoreLineEndingDifferences: true);
114113
}
115114

116115
[Fact]
@@ -132,20 +131,20 @@ public void CanNest()
132131
border-radius: 4px;
133132
padding: 8px 12px;
134133
}
135-
""", css.ToString());
134+
""", css.ToString(), ignoreLineEndingDifferences: true);
136135
}
137136

138137
[Fact]
139138
public void B()
140139
{
141-
var sheet = StyleSheet.Parse(
140+
var css = StyleSheet.Parse(
142141
"""
143142
:is(section, article, aside, nav) h1 {
144143
font-size: 25px;
145144
}
146145
""", new CssContext());
147146

148-
var rule = (StyleRule)sheet.Children[0];
147+
var rule = (StyleRule)css.Children[0];
149148

150149
Assert.Single(rule.Selector);
151150

@@ -163,6 +162,6 @@ public void B()
163162
:is(section, article, aside, nav) h1 {
164163
font-size: 25px;
165164
}
166-
""", sheet.ToString());
165+
""", css.ToString(), ignoreLineEndingDifferences: true);
167166
}
168167
}

src/Carbon.Css.Tests/Modules/MaskingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ public void A()
2020
-webkit-mask-image: url('mask.svg');
2121
mask-image: url('mask.svg');
2222
}
23-
""", sheet.ToString());
23+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
2424
}
2525
}

src/Carbon.Css.Tests/NativeFunctionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public void A(string declaration, string? expected = null)
3333
div {
3434
{{expected ?? declaration}};
3535
}
36-
""", css.ToString());
36+
""", css.ToString(), ignoreLineEndingDifferences: true);
3737
}
3838
}

src/Carbon.Css.Tests/Scss/FunctionTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public void LightenAndDarken()
1414
div { color: lighten($red, 0.2); }
1515
""");
1616

17-
1817
Assert.Equal(
1918
"""
2019
div {
@@ -23,7 +22,7 @@ public void LightenAndDarken()
2322
div {
2423
color: #f66;
2524
}
26-
""", sheet.ToString());
25+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
2726
}
2827

2928
[Fact]
@@ -49,7 +48,7 @@ @mixin hi() {
4948
color: #c00;
5049
color: #f66;
5150
}
52-
""", sheet.ToString());
51+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
5352
}
5453

5554
[Fact]
@@ -85,7 +84,7 @@ div div {
8584
color: #a11721;
8685
color: #ccc;
8786
}
88-
""", sheet.ToString());
87+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
8988
}
9089

9190
[Fact]
@@ -121,7 +120,7 @@ div .placeholderText {
121120
-webkit-font-smoothing: antialiased;
122121
z-index: 2;
123122
}
124-
""", ss.ToString());
123+
""", ss.ToString(), ignoreLineEndingDifferences: true);
125124
}
126125

127126
[Fact]
@@ -228,6 +227,6 @@ .block .description p {
228227
.block .description {
229228
padding: 5px 250px 20px 225px;
230229
}
231-
""", ss.ToString());
230+
""", ss.ToString(), ignoreLineEndingDifferences: true);
232231
}
233232
}

src/Carbon.Css.Tests/Scss/MixinTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ .happy dt {
192192
.happy dd {
193193
padding-left: 8.125em;
194194
}
195-
""", ss.ToString());
195+
""", ss.ToString(), ignoreLineEndingDifferences: true);
196196
}
197197

198198
[Fact]

src/Carbon.Css.Tests/Scss/NestingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void SelectorListWithNestedReference()
8484
span .hide {
8585
display: none;
8686
}
87-
""", css.ToString());
87+
""", css.ToString(), ignoreLineEndingDifferences: true);
8888
}
8989

9090
[Fact]

src/Carbon.Css.Tests/Scss/ScssTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void DoubleList()
7171
-webkit-transition: -webkit-transform 0.04s linear, opacity 0.04s linear, visibility 0.04s linear;
7272
transition: transform 0.04s linear, opacity 0.04s linear, visibility 0.04s linear;
7373
}
74-
""", sheet.ToString());
74+
""", sheet.ToString(), ignoreLineEndingDifferences: true);
7575
}
7676

7777
[Fact]

0 commit comments

Comments
 (0)