Skip to content

Commit b755c1e

Browse files
shellscapegwynne
andauthored
Update test/word.test.ts
Co-authored-by: Gwynne Raskind <gwynne@darkrainfall.org>
1 parent 6ba896c commit b755c1e

1 file changed

Lines changed: 28 additions & 8 deletions

File tree

test/word.test.ts

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,34 @@ describe('word parsing', () => {
3030
}
3131

3232
const urlFixtures = [
33-
{ fixture: 'url(https://example.com/image.png)', label: 'unquoted absolute URL' },
34-
{ fixture: "url('https://example.com/image.png')", label: 'single-quoted absolute URL' },
35-
{ fixture: 'url("https://example.com/image.png")', label: 'double-quoted absolute URL' },
36-
{ fixture: 'url(/images/image.png)', label: 'unquoted relative URL' },
37-
{ fixture: "url('/images/image.png')", label: 'single-quoted relative URL' },
38-
{ fixture: 'url("/images/image.png")', label: 'double-quoted relative URL' },
39-
{ fixture: 'url(//cdn.example.com/image.png)', label: 'protocol-relative URL' },
40-
{ fixture: 'url()', label: 'empty URL value' }
33+
{ fixture: 'url(https://example.com/image.png)', label: 'unquoted full URL' },
34+
{ fixture: 'url(/images/image.png)', label: 'unquoted absolute file path' },
35+
{ fixture: 'url(images/image.png)', label: 'unquoted relative file path' },
36+
{ fixture: 'url(./images/image.png)', label: 'unquoted relative file path with leading ./' },
37+
38+
{ fixture: "url('https://example.com/image.png')", label: 'single-quoted full URL' },
39+
{ fixture: "url('/images/image.png')", label: 'single-quoted absolute file path' },
40+
{ fixture: "url('images/image.png')", label: 'single-quoted relative file path' },
41+
{ fixture: "url('./images/image.png')", label: 'single-quoted relative file path with leading ./' },
42+
43+
{ fixture: 'url("https://example.com/image.png")', label: 'double-quoted full URL' },
44+
{ fixture: 'url("/images/image.png")', label: 'double-quoted absolute file path' },
45+
{ fixture: 'url("images/image.png")', label: 'double-quoted relative file path' },
46+
{ fixture: 'url("./images/image.png")', label: 'double-quoted relative file path with leading ./' },
47+
48+
{ fixture: "url('https://example.com/image.png?1234567890#abcdef')", label: 'single-quoted full URL with query and fragment' },
49+
{ fixture: "url('/images/image.png?1234567890#abcdef')", label: 'single-quoted absolute file path with query and fragment' },
50+
{ fixture: "url('images/image.png?1234567890#abcdef')", label: 'single-quoted relative file path with query and fragment' },
51+
{ fixture: "url('./images/image.png?1234567890#abcdef')", label: 'single-quoted relative file path with leading ./, query, and fragment' },
52+
53+
{ fixture: 'url("https://example.com/image.png?1234567890#abcdef")', label: 'double-quoted full URL with query and fragment' },
54+
{ fixture: 'url("/images/image.png?1234567890#abcdef")', label: 'double-quoted absolute file path with query and fragment' },
55+
{ fixture: 'url("images/image.png?1234567890#abcdef")', label: 'double-quoted relative file path with query and fragment' },
56+
{ fixture: 'url("./images/image.png?1234567890#abcdef")', label: 'double-quoted relative file path with leading ./, query, and fragment' },
57+
58+
{ fixture: 'url()', label: 'empty URL value' },
59+
{ fixture: "url('')", label: 'empty single-quoted URL value' },
60+
{ fixture: 'url("")', label: 'empty double-quoted URL value' }
4161
];
4262

4363
for (const { fixture, label } of urlFixtures) {

0 commit comments

Comments
 (0)