@@ -20,56 +20,56 @@ test.describe("Parser", function() { with(this) {
20
20
} } )
21
21
22
22
it ( "parses one offer with no params" , function ( ) { with ( this ) {
23
- assertEqual ( [ { name : "a" , params : { } } ] ,
23
+ assertEqual ( [ { name : "a" , params : { } } ] ,
24
24
parse ( 'a' ) )
25
25
} } )
26
26
27
27
it ( "parses two offers with no params" , function ( ) { with ( this ) {
28
- assertEqual ( [ { name : "a" , params : { } } , { name : "b" , params : { } } ] ,
28
+ assertEqual ( [ { name : "a" , params : { } } , { name : "b" , params : { } } ] ,
29
29
parse ( 'a, b' ) )
30
30
} } )
31
31
32
32
it ( "parses a duplicate offer name" , function ( ) { with ( this ) {
33
- assertEqual ( [ { name : "a" , params : { } } , { name : "a" , params : { } } ] ,
33
+ assertEqual ( [ { name : "a" , params : { } } , { name : "a" , params : { } } ] ,
34
34
parse ( 'a, a' ) )
35
35
} } )
36
36
37
37
it ( "parses a flag" , function ( ) { with ( this ) {
38
- assertEqual ( [ { name : "a" , params : { b : true } } ] ,
38
+ assertEqual ( [ { name : "a" , params : { b : true } } ] ,
39
39
parse ( 'a; b' ) )
40
40
} } )
41
41
42
42
it ( "parses an unquoted param" , function ( ) { with ( this ) {
43
- assertEqual ( [ { name : "a" , params : { b : 1 } } ] ,
43
+ assertEqual ( [ { name : "a" , params : { b : 1 } } ] ,
44
44
parse ( 'a; b=1' ) )
45
45
} } )
46
46
47
47
it ( "parses a quoted param" , function ( ) { with ( this ) {
48
- assertEqual ( [ { name : "a" , params : { b : 'hi, "there' } } ] ,
48
+ assertEqual ( [ { name : "a" , params : { b : 'hi, "there' } } ] ,
49
49
parse ( 'a; b="hi, \\"there"' ) )
50
50
} } )
51
51
52
52
it ( "parses multiple params" , function ( ) { with ( this ) {
53
- assertEqual ( [ { name : "a" , params : { b : true , c : 1 , d : 'hi' } } ] ,
53
+ assertEqual ( [ { name : "a" , params : { b : true , c : 1 , d : 'hi' } } ] ,
54
54
parse ( 'a; b; c=1; d="hi"' ) )
55
55
} } )
56
56
57
57
it ( "parses duplicate params" , function ( ) { with ( this ) {
58
- assertEqual ( [ { name : "a" , params : { b : [ true , 'hi' ] , c : 1 } } ] ,
58
+ assertEqual ( [ { name : "a" , params : { b : [ true , 'hi' ] , c : 1 } } ] ,
59
59
parse ( 'a; b; c=1; b="hi"' ) )
60
60
} } )
61
61
62
62
it ( "parses multiple complex offers" , function ( ) { with ( this ) {
63
- assertEqual ( [ { name : "a" , params : { b : 1 } } ,
64
- { name : "c" , params : { } } ,
65
- { name : "b" , params : { d : true } } ,
66
- { name : "c" , params : { e : [ 'hi, there' , true ] } } ,
67
- { name : "a" , params : { b : true } } ] ,
63
+ assertEqual ( [ { name : "a" , params : { b : 1 } } ,
64
+ { name : "c" , params : { } } ,
65
+ { name : "b" , params : { d : true } } ,
66
+ { name : "c" , params : { e : [ 'hi, there' , true ] } } ,
67
+ { name : "a" , params : { b : true } } ] ,
68
68
parse ( 'a; b=1, c, b; d, c; e="hi, there"; e, a; b' ) )
69
69
} } )
70
70
71
71
it ( "parses an extension name that shadows an Object property" , function ( ) { with ( this ) {
72
- assertEqual ( [ { name : "hasOwnProperty" , params : { } } ] ,
72
+ assertEqual ( [ { name : "hasOwnProperty" , params : { } } ] ,
73
73
parse ( 'hasOwnProperty' ) )
74
74
} } )
75
75
@@ -86,23 +86,23 @@ test.describe("Parser", function() { with(this) {
86
86
} } )
87
87
88
88
it ( "serializes a flag" , function ( ) { with ( this ) {
89
- assertEqual ( 'a; b' , Parser . serializeParams ( 'a' , { b : true } ) )
89
+ assertEqual ( 'a; b' , Parser . serializeParams ( 'a' , { b : true } ) )
90
90
} } )
91
91
92
92
it ( "serializes an unquoted param" , function ( ) { with ( this ) {
93
- assertEqual ( 'a; b=42' , Parser . serializeParams ( 'a' , { b : '42' } ) )
93
+ assertEqual ( 'a; b=42' , Parser . serializeParams ( 'a' , { b : '42' } ) )
94
94
} } )
95
95
96
96
it ( "serializes a quoted param" , function ( ) { with ( this ) {
97
- assertEqual ( 'a; b="hi, there"' , Parser . serializeParams ( 'a' , { b : 'hi, there' } ) )
97
+ assertEqual ( 'a; b="hi, there"' , Parser . serializeParams ( 'a' , { b : 'hi, there' } ) )
98
98
} } )
99
99
100
100
it ( "serializes multiple params" , function ( ) { with ( this ) {
101
- assertEqual ( 'a; b; c=1; d=hi' , Parser . serializeParams ( 'a' , { b : true , c : 1 , d : 'hi' } ) )
101
+ assertEqual ( 'a; b; c=1; d=hi' , Parser . serializeParams ( 'a' , { b : true , c : 1 , d : 'hi' } ) )
102
102
} } )
103
103
104
104
it ( "serializes duplicate params" , function ( ) { with ( this ) {
105
- assertEqual ( 'a; b; b=hi; c=1' , Parser . serializeParams ( 'a' , { b : [ true , 'hi' ] , c : 1 } ) )
105
+ assertEqual ( 'a; b; b=hi; c=1' , Parser . serializeParams ( 'a' , { b : [ true , 'hi' ] , c : 1 } ) )
106
106
} } )
107
107
} } )
108
108
} } )
0 commit comments