Debian Codegraph @

autoprefixer/test/brackets.test.js

raw symbols SCIP
1 let { test } = require('uvu')
2 let { equal } = require('uvu/assert')
3
4 let brackets = require('../lib/brackets')
5
6 test('parses simple string', () => {
7 equal(brackets.parse('test'), ['test'])
8 })
9
10 test('parses brackets', () => {
11 equal(brackets.parse('a (b) a'), ['a ', ['b'], ' a'])
12 })
13
14 test('parses many brackets', () => {
15 equal(brackets.parse('a (b ()) a'), ['a ', ['b ', [''], ''], ' a'])
16 })
17
18 test('parses errors', () => {
19 equal(brackets.parse('a (b ('), ['a ', ['b ', ['']]])
20 })
21
22 test('stringifies simple string', () => {
23 equal(brackets.stringify(['test']), 'test')
24 })
25
26 test('stringifies brackets', () => {
27 equal(brackets.stringify(['a ', ['b'], ' a']), 'a (b) a')
28 })
29
30 test('stringifies many brackets', () => {
31 equal(brackets.stringify(['a ', ['b ', [''], ''], ' a']), 'a (b ()) a')
32 })
33
34 test.run()