@@ -21,10 +21,11 @@ describe('UNIT: Directive', function () {
2121
2222 it ( 'should return array with the string if it\'s a single clause' , function ( ) {
2323 var e ,
24- test1 = 'fsef' ,
25- test2 = 'ffsef + "fse& fsef"' ,
24+ test1 = 'fsef(a, b, c) ' ,
25+ test2 = 'ffsef + "fse, fsef"' ,
2626 test3 = 'fsef + \'fesfsfe\'' ,
27- test4 = '\"fsefsf&fsef&fsef\"'
27+ test4 = '\"fsefsf,fsef,fsef\"' ,
28+ test5 = '(a, b)'
2829
2930 e = Directive . split ( test1 )
3031 assert . strictEqual ( e . length , 1 )
@@ -41,31 +42,35 @@ describe('UNIT: Directive', function () {
4142 e = Directive . split ( test4 )
4243 assert . strictEqual ( e . length , 1 )
4344 assert . strictEqual ( e [ 0 ] , test4 )
45+
46+ e = Directive . split ( test5 )
47+ assert . strictEqual ( e . length , 1 )
48+ assert . strictEqual ( e [ 0 ] , test5 )
4449 } )
4550
4651 it ( 'should return split multiple clauses correctly' , function ( ) {
4752 var e ,
48- test1 = [ 'fsef && ggg ' , 'fsf:fsefsef ' ] ,
49- test2 = [ 'asf-fsef:fsf' , '"efs&sefsf "' ] ,
50- test3 = [ '\'fsef& sef\'' , 'fse:fsf' ] ,
51- test4 = [ '\"fsef& fsef\"' , 'sefsef\'fesfsf' ]
53+ test1 = [ '(fse,fggg) ' , 'fsf:({a:1,b:2}, [1,2,3]) ' ] ,
54+ test2 = [ 'asf-fsef:fsf' , '"efs,s(e,f)sf "' ] ,
55+ test3 = [ '\'fsef, sef\'' , 'fse:fsf(a,b,c) ' ] ,
56+ test4 = [ '\"fsef, fsef\"' , 'sefsef\'fesfsf' ]
5257
53- e = Directive . split ( test1 . join ( '& ' ) )
54- assert . strictEqual ( e . length , 2 , 'expression with && ' )
58+ e = Directive . split ( test1 . join ( ', ' ) )
59+ assert . strictEqual ( e . length , 2 , 'expression with {}, [] inside () ' )
5560 assert . strictEqual ( e [ 0 ] , test1 [ 0 ] )
5661 assert . strictEqual ( e [ 1 ] , test1 [ 1 ] )
5762
58- e = Directive . split ( test2 . join ( '& ' ) )
63+ e = Directive . split ( test2 . join ( ', ' ) )
5964 assert . strictEqual ( e . length , 2 , 'expression with double quotes' )
6065 assert . strictEqual ( e [ 0 ] , test2 [ 0 ] )
6166 assert . strictEqual ( e [ 1 ] , test2 [ 1 ] )
6267
63- e = Directive . split ( test3 . join ( '& ' ) )
68+ e = Directive . split ( test3 . join ( ', ' ) )
6469 assert . strictEqual ( e . length , 2 , 'expression with single quotes' )
6570 assert . strictEqual ( e [ 0 ] , test3 [ 0 ] )
6671 assert . strictEqual ( e [ 1 ] , test3 [ 1 ] )
6772
68- e = Directive . split ( test4 . join ( '& ' ) )
73+ e = Directive . split ( test4 . join ( ', ' ) )
6974 assert . strictEqual ( e . length , 2 , 'expression with escaped quotes' )
7075 assert . strictEqual ( e [ 0 ] , test4 [ 0 ] )
7176 assert . strictEqual ( e [ 1 ] , test4 [ 1 ] )
0 commit comments