@@ -38,7 +38,9 @@ describe('split value', () => {
3838 } ) ;
3939
4040 it ( 'should get value' , ( ) => {
41- const res = func ( 'foo bar' , ',' ) ;
41+ const res = func ( 'foo bar' , {
42+ delimiter : ','
43+ } ) ;
4244 assert . deepEqual ( res , [ 'foo bar' ] , 'result' ) ;
4345 } ) ;
4446
@@ -48,7 +50,9 @@ describe('split value', () => {
4850 } ) ;
4951
5052 it ( 'should get value' , ( ) => {
51- const res = func ( 'foo bar' , ',' ) ;
53+ const res = func ( 'foo bar' , {
54+ delimiter : ','
55+ } ) ;
5256 assert . deepEqual ( res , [ 'foo bar' ] , 'result' ) ;
5357 } ) ;
5458
@@ -58,19 +62,48 @@ describe('split value', () => {
5862 } ) ;
5963
6064 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+ preserveComment : true
74+ } ) ;
6275 assert . deepEqual ( res , [ 'foo' , 'bar' ] , 'result' ) ;
6376 } ) ;
6477
6578 it ( 'should get value' , ( ) => {
66- const res = func ( ',' , ',' ) ;
79+ const res = func ( 'foo /* comment */ , bar' , {
80+ delimiter : ',' ,
81+ preserveComment : true
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+ delimiter : ',' ,
89+ preserveComment : true
90+ } ) ;
91+ assert . deepEqual ( res , [ 'foo /* comment */ bar' , 'baz' ] , 'result' ) ;
92+ } ) ;
93+
94+ it ( 'should get value' , ( ) => {
95+ const res = func ( ',' , {
96+ delimiter : ','
97+ } ) ;
6798 assert . deepEqual ( res , [ '' , '' ] , 'result' ) ;
6899 } ) ;
69100
70101 it ( 'should get value' , ( ) => {
71102 const res = func (
72103 'linear-gradient(red, blue), radial-gradient(yellow, green)' ,
73- ','
104+ {
105+ delimiter : ','
106+ }
74107 ) ;
75108 assert . deepEqual (
76109 res ,
0 commit comments