Skip to content

Commit 4a373b9

Browse files
committed
add test case for escaped Lang
1 parent dc15b6f commit 4a373b9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/parse-selector.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,6 +2052,20 @@ describe('Selector Nodes', () => {
20522052
expect(lang1.type).toBe(LANG_SELECTOR)
20532053
expect(lang1.text).toBe('"*-Latn"')
20542054
})
2055+
2056+
test(':lang(\\*-Latn) with escaped wildcard', () => {
2057+
const root = parse_selector(':lang(\\*-Latn)')
2058+
2059+
const selector = root.first_child! as Selector
2060+
const langPseudoClass = selector.first_child! as PseudoClassSelector
2061+
expect(langPseudoClass.type).toBe(PSEUDO_CLASS_SELECTOR)
2062+
expect(langPseudoClass.text).toBe(':lang(\\*-Latn)')
2063+
expect(langPseudoClass.child_count).toBe(1)
2064+
2065+
const lang1 = langPseudoClass.first_child!
2066+
expect(lang1.type).toBe(LANG_SELECTOR)
2067+
expect(lang1.text).toBe('\\*-Latn')
2068+
})
20552069
})
20562070

20572071
describe(':is() and :where() pseudo-classes', () => {

0 commit comments

Comments
 (0)