@@ -38,7 +38,9 @@ describe('split value', () => {
38
38
} ) ;
39
39
40
40
it ( 'should get value' , ( ) => {
41
- const res = func ( 'foo bar' , ',' ) ;
41
+ const res = func ( 'foo bar' , {
42
+ delimiter : ','
43
+ } ) ;
42
44
assert . deepEqual ( res , [ 'foo bar' ] , 'result' ) ;
43
45
} ) ;
44
46
@@ -48,7 +50,9 @@ describe('split value', () => {
48
50
} ) ;
49
51
50
52
it ( 'should get value' , ( ) => {
51
- const res = func ( 'foo bar' , ',' ) ;
53
+ const res = func ( 'foo bar' , {
54
+ delimiter : ','
55
+ } ) ;
52
56
assert . deepEqual ( res , [ 'foo bar' ] , 'result' ) ;
53
57
} ) ;
54
58
@@ -58,19 +62,48 @@ describe('split value', () => {
58
62
} ) ;
59
63
60
64
it ( 'should get value' , ( ) => {
61
- const res = func ( 'foo /* comment */ , bar' , ',' ) ;
65
+ const res = func ( 'foo /* comment */ , bar' , {
66
+ delimiter : ','
67
+ } ) ;
68
+ assert . deepEqual ( res , [ 'foo' , 'bar' ] , 'result' ) ;
69
+ } ) ;
70
+
71
+ it ( 'should get value' , ( ) => {
72
+ const res = func ( 'foo /* comment */ bar' , {
73
+ comment : true
74
+ } ) ;
62
75
assert . deepEqual ( res , [ 'foo' , 'bar' ] , 'result' ) ;
63
76
} ) ;
64
77
65
78
it ( 'should get value' , ( ) => {
66
- const res = func ( ',' , ',' ) ;
79
+ const res = func ( 'foo /* comment */ , bar' , {
80
+ comment : true ,
81
+ delimiter : ','
82
+ } ) ;
83
+ assert . deepEqual ( res , [ 'foo /* comment */' , 'bar' ] , 'result' ) ;
84
+ } ) ;
85
+
86
+ it ( 'should get value' , ( ) => {
87
+ const res = func ( 'foo /* comment */ bar, baz' , {
88
+ comment : true ,
89
+ delimiter : ','
90
+ } ) ;
91
+ assert . deepEqual ( res , [ 'foo /* comment */ bar' , 'baz' ] , 'result' ) ;
92
+ } ) ;
93
+
94
+ it ( 'should get value' , ( ) => {
95
+ const res = func ( ',' , {
96
+ delimiter : ','
97
+ } ) ;
67
98
assert . deepEqual ( res , [ '' , '' ] , 'result' ) ;
68
99
} ) ;
69
100
70
101
it ( 'should get value' , ( ) => {
71
102
const res = func (
72
103
'linear-gradient(red, blue), radial-gradient(yellow, green)' ,
73
- ','
104
+ {
105
+ delimiter : ','
106
+ }
74
107
) ;
75
108
assert . deepEqual (
76
109
res ,
0 commit comments