Skip to content

Commit 37e91dc

Browse files
committed
fix: enable serialized test execution and update snapshots
- Uncomment .serialized trait in SnapshotTests to fix SIGSEGV crashes on Linux - Update snapshot formatting in input, ins, mark, and u element tests - Ensures tests run serially on @mainactor to prevent parallel execution issues
1 parent 7a6aeb1 commit 37e91dc

File tree

5 files changed

+134
-134
lines changed

5 files changed

+134
-134
lines changed

Tests/HTMLElementsPointFreeHTML Tests/Support/SnapshotTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Testing
33

44
@MainActor
55
@Suite(
6-
// .serialized,
6+
.serialized,
77
.snapshots(record: .missing)
88
)
99
struct SnapshotTests {}

Tests/HTMLElementsPointFreeHTML Tests/input Input Tests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ extension SnapshotTests {
161161
as: .html
162162
) {
163163
#"""
164-
<input size="30" placeholder="username@example.com" pattern=".+@example\.com" multiple minlength="5" maxlength="64" value="user@example.com" type="email" name="email">
165-
"""#
164+
<input size="30" placeholder="username@example.com" pattern=".+@example\.com" multiple minlength="5" maxlength="64" value="user@example.com" type="email" name="email">
165+
"""#
166166
}
167167
}
168168

@@ -308,8 +308,8 @@ extension SnapshotTests {
308308
as: .html
309309
) {
310310
#"""
311-
<input inputmode="text" autocomplete="new-password" size="30" placeholder="Enter password" pattern="[A-Za-z0-9\d@$!%*?&amp;]{8,}" minlength="8" maxlength="64" type="password" name="password">
312-
"""#
311+
<input inputmode="text" autocomplete="new-password" size="30" placeholder="Enter password" pattern="[A-Za-z0-9\d@$!%*?&amp;]{8,}" minlength="8" maxlength="64" type="password" name="password">
312+
"""#
313313
}
314314
}
315315

@@ -337,8 +337,8 @@ extension SnapshotTests {
337337
as: .html
338338
) {
339339
#"""
340-
<input inputmode="numeric" autocomplete="one-time-code" size="8" placeholder="Enter PIN" pattern="\d{4,8}" minlength="4" maxlength="8" type="password" name="pin">
341-
"""#
340+
<input inputmode="numeric" autocomplete="one-time-code" size="8" placeholder="Enter PIN" pattern="\d{4,8}" minlength="4" maxlength="8" type="password" name="pin">
341+
"""#
342342
}
343343
}
344344

@@ -725,8 +725,8 @@ extension SnapshotTests {
725725
as: .html
726726
) {
727727
#"""
728-
<input required spellcheck="false" size="50" placeholder="https://example.mydomain.com" pattern="https://.*\.mydomain\.com" minlength="10" maxlength="100" list="website-suggestions" type="url" name="website">
729-
"""#
728+
<input required spellcheck="false" size="50" placeholder="https://example.mydomain.com" pattern="https://.*\.mydomain\.com" minlength="10" maxlength="100" list="website-suggestions" type="url" name="website">
729+
"""#
730730
}
731731
}
732732

Tests/HTMLElementsPointFreeHTML Tests/ins Inserted Text Tests.swift

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ extension SnapshotTests {
119119
) {
120120
"""
121121
122-
<p>The meeting will be held on
123-
<ins datetime="2024-03-01T09:00:00Z" cite="https://example.com/meeting-updates/456">Friday, March 8th at 2:00 PM
124-
</ins> in the main conference room.
125-
</p>
126-
"""
122+
<p>The meeting will be held on
123+
<ins datetime="2024-03-01T09:00:00Z" cite="https://example.com/meeting-updates/456">Friday, March 8th at 2:00 PM
124+
</ins> in the main conference room.
125+
</p>
126+
"""
127127
}
128128
}
129129

@@ -185,45 +185,45 @@ extension SnapshotTests {
185185
as: .html
186186
) {
187187
"""
188-
<!doctype html>
189-
<html>
190-
<head>
191-
<style>
188+
<!doctype html>
189+
<html>
190+
<head>
191+
<style>
192192
193-
</style>
194-
</head>
195-
<body>
196-
<article>
197-
<h2>Document Revision History
198-
</h2>
199-
<section>
200-
<h3>Version 2.1 Changes
201-
</h3>
202-
<p>This document has been updated to include:
203-
</p>
204-
<ul>
205-
<li>
206-
<ins datetime="2024-01-15T11:30:00Z" cite="https://example.com/updates/security">Enhanced security protocols
207-
</ins>
208-
</li>
209-
<li>
210-
<ins datetime="2024-01-20T14:15:00Z" cite="https://example.com/updates/accessibility">Improved accessibility guidelines
211-
</ins>
212-
</li>
213-
<li>
214-
<ins datetime="2024-01-25T10:00:00Z">Additional code examples and best practices
215-
</ins>
216-
</li>
217-
</ul>
218-
</section>
219-
<p>For technical specifications, please refer to
220-
<ins datetime="2024-02-01T16:30:00Z" cite="https://example.com/technical-specs/v2.1"><a href="https://example.com/specs">the updated technical documentation</a>
221-
</ins>.
222-
</p>
223-
</article>
224-
</body>
225-
</html>
226-
"""
193+
</style>
194+
</head>
195+
<body>
196+
<article>
197+
<h2>Document Revision History
198+
</h2>
199+
<section>
200+
<h3>Version 2.1 Changes
201+
</h3>
202+
<p>This document has been updated to include:
203+
</p>
204+
<ul>
205+
<li>
206+
<ins datetime="2024-01-15T11:30:00Z" cite="https://example.com/updates/security">Enhanced security protocols
207+
</ins>
208+
</li>
209+
<li>
210+
<ins datetime="2024-01-20T14:15:00Z" cite="https://example.com/updates/accessibility">Improved accessibility guidelines
211+
</ins>
212+
</li>
213+
<li>
214+
<ins datetime="2024-01-25T10:00:00Z">Additional code examples and best practices
215+
</ins>
216+
</li>
217+
</ul>
218+
</section>
219+
<p>For technical specifications, please refer to
220+
<ins datetime="2024-02-01T16:30:00Z" cite="https://example.com/technical-specs/v2.1"><a href="https://example.com/specs">the updated technical documentation</a>
221+
</ins>.
222+
</p>
223+
</article>
224+
</body>
225+
</html>
226+
"""
227227
}
228228
}
229229
}

Tests/HTMLElementsPointFreeHTML Tests/mark Mark Text Tests.swift

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ extension SnapshotTests {
3636
) {
3737
"""
3838
39-
<p>Please review the
40-
<mark>updated section
41-
</mark> carefully.
42-
</p>
43-
"""
39+
<p>Please review the
40+
<mark>updated section
41+
</mark> carefully.
42+
</p>
43+
"""
4444
}
4545
}
4646

@@ -62,13 +62,13 @@ extension SnapshotTests {
6262
) {
6363
"""
6464
65-
<p>Search results for '
66-
<mark>swift
67-
</mark>': The
68-
<mark>Swift
69-
</mark> programming language is powerful and intuitive.
70-
</p>
71-
"""
65+
<p>Search results for '
66+
<mark>swift
67+
</mark>': The
68+
<mark>Swift
69+
</mark> programming language is powerful and intuitive.
70+
</p>
71+
"""
7272
}
7373
}
7474

@@ -115,27 +115,27 @@ extension SnapshotTests {
115115
as: .html
116116
) {
117117
"""
118-
<!doctype html>
119-
<html>
120-
<head>
121-
<style>
118+
<!doctype html>
119+
<html>
120+
<head>
121+
<style>
122122
123-
</style>
124-
</head>
125-
<body>
126-
<div>
127-
<h2>Document Review
128-
</h2>
129-
<p>Changes were made to
130-
<mark>section 3.2
131-
</mark> and
132-
<mark>appendix B
133-
</mark>.
134-
</p>
135-
</div>
136-
</body>
137-
</html>
138-
"""
123+
</style>
124+
</head>
125+
<body>
126+
<div>
127+
<h2>Document Review
128+
</h2>
129+
<p>Changes were made to
130+
<mark>section 3.2
131+
</mark> and
132+
<mark>appendix B
133+
</mark>.
134+
</p>
135+
</div>
136+
</body>
137+
</html>
138+
"""
139139
}
140140
}
141141
}

Tests/HTMLElementsPointFreeHTML Tests/u Unarticulated Annotation (Underline) Tests.swift

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ extension SnapshotTests {
5858
) {
5959
"""
6060
61-
<p>Please check the
62-
<u>seperate
63-
</u> document for more information.
64-
</p>
65-
"""
61+
<p>Please check the
62+
<u>seperate
63+
</u> document for more information.
64+
</p>
65+
"""
6666
}
6767
}
6868

@@ -103,11 +103,11 @@ extension SnapshotTests {
103103
) {
104104
"""
105105
106-
<p>The city
107-
<u>北京
108-
</u> (Beijing) is the capital of China.
109-
</p>
110-
"""
106+
<p>The city
107+
<u>北京
108+
</u> (Beijing) is the capital of China.
109+
</p>
110+
"""
111111
}
112112
}
113113

@@ -182,47 +182,47 @@ extension SnapshotTests {
182182
as: .html
183183
) {
184184
"""
185-
<!doctype html>
186-
<html>
187-
<head>
188-
<style>
185+
<!doctype html>
186+
<html>
187+
<head>
188+
<style>
189189
190-
</style>
191-
</head>
192-
<body>
193-
<article>
194-
<h2>Language Learning Exercise
195-
</h2>
196-
<section>
197-
<h3>Chinese Proper Names
198-
</h3>
199-
<p>Identify the proper names in the following text:
200-
</p>
201-
<p>在古代中国,
202-
<u>孔子
203-
</u>是一位伟大的哲学家。他的思想影响了整个
204-
<u>中华文明
205-
</u>。
206-
</p>
207-
</section>
208-
<section>
209-
<h3>Spelling Check
210-
</h3>
211-
<p>The following paragraph contains spelling errors:
212-
</p>
213-
<p>The
214-
<u>recieve
215-
</u> function should
216-
<u>seperate
217-
</u> the data into
218-
<u>differnt
219-
</u> categories.
220-
</p>
221-
</section>
222-
</article>
223-
</body>
224-
</html>
225-
"""
190+
</style>
191+
</head>
192+
<body>
193+
<article>
194+
<h2>Language Learning Exercise
195+
</h2>
196+
<section>
197+
<h3>Chinese Proper Names
198+
</h3>
199+
<p>Identify the proper names in the following text:
200+
</p>
201+
<p>在古代中国,
202+
<u>孔子
203+
</u>是一位伟大的哲学家。他的思想影响了整个
204+
<u>中华文明
205+
</u>。
206+
</p>
207+
</section>
208+
<section>
209+
<h3>Spelling Check
210+
</h3>
211+
<p>The following paragraph contains spelling errors:
212+
</p>
213+
<p>The
214+
<u>recieve
215+
</u> function should
216+
<u>seperate
217+
</u> the data into
218+
<u>differnt
219+
</u> categories.
220+
</p>
221+
</section>
222+
</article>
223+
</body>
224+
</html>
225+
"""
226226
}
227227
}
228228
}

0 commit comments

Comments
 (0)