@@ -21,10 +21,11 @@ describe('UNIT: Directive', function () {
21
21
22
22
it ( 'should return array with the string if it\'s a single clause' , function ( ) {
23
23
var e ,
24
- test1 = 'fsef' ,
25
- test2 = 'ffsef + "fse& fsef"' ,
24
+ test1 = 'fsef(a, b, c) ' ,
25
+ test2 = 'ffsef + "fse, fsef"' ,
26
26
test3 = 'fsef + \'fesfsfe\'' ,
27
- test4 = '\"fsefsf&fsef&fsef\"'
27
+ test4 = '\"fsefsf,fsef,fsef\"' ,
28
+ test5 = '(a, b)'
28
29
29
30
e = Directive . split ( test1 )
30
31
assert . strictEqual ( e . length , 1 )
@@ -41,31 +42,35 @@ describe('UNIT: Directive', function () {
41
42
e = Directive . split ( test4 )
42
43
assert . strictEqual ( e . length , 1 )
43
44
assert . strictEqual ( e [ 0 ] , test4 )
45
+
46
+ e = Directive . split ( test5 )
47
+ assert . strictEqual ( e . length , 1 )
48
+ assert . strictEqual ( e [ 0 ] , test5 )
44
49
} )
45
50
46
51
it ( 'should return split multiple clauses correctly' , function ( ) {
47
52
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' ]
52
57
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 () ' )
55
60
assert . strictEqual ( e [ 0 ] , test1 [ 0 ] )
56
61
assert . strictEqual ( e [ 1 ] , test1 [ 1 ] )
57
62
58
- e = Directive . split ( test2 . join ( '& ' ) )
63
+ e = Directive . split ( test2 . join ( ', ' ) )
59
64
assert . strictEqual ( e . length , 2 , 'expression with double quotes' )
60
65
assert . strictEqual ( e [ 0 ] , test2 [ 0 ] )
61
66
assert . strictEqual ( e [ 1 ] , test2 [ 1 ] )
62
67
63
- e = Directive . split ( test3 . join ( '& ' ) )
68
+ e = Directive . split ( test3 . join ( ', ' ) )
64
69
assert . strictEqual ( e . length , 2 , 'expression with single quotes' )
65
70
assert . strictEqual ( e [ 0 ] , test3 [ 0 ] )
66
71
assert . strictEqual ( e [ 1 ] , test3 [ 1 ] )
67
72
68
- e = Directive . split ( test4 . join ( '& ' ) )
73
+ e = Directive . split ( test4 . join ( ', ' ) )
69
74
assert . strictEqual ( e . length , 2 , 'expression with escaped quotes' )
70
75
assert . strictEqual ( e [ 0 ] , test4 [ 0 ] )
71
76
assert . strictEqual ( e [ 1 ] , test4 [ 1 ] )
0 commit comments