@@ -126,10 +126,12 @@ describe('parser', (): void => {
126126 ] ) ;
127127 } ) ;
128128 it ( 'semantic markup test' , ( ) : void => {
129- expect ( parse ( 'foo E(a\\),b) P(foo.bar.baz#bam) baz V( b\\,\\na\\)\\\\m\\, ) O(foo) ' ) ) . toEqual ( [
129+ expect ( parse ( 'foo E(a\\),b) E(foo=bar=baz) P(foo.bar.baz#bam) baz V( b\\,\\na\\)\\\\m\\, ) O(foo) ' ) ) . toEqual ( [
130130 [
131131 { type : PartType . TEXT , text : 'foo ' , source : undefined } ,
132- { type : PartType . ENV_VARIABLE , name : 'a),b' , source : undefined } ,
132+ { type : PartType . ENV_VARIABLE , name : 'a),b' , value : undefined , source : undefined } ,
133+ { type : PartType . TEXT , text : ' ' , source : undefined } ,
134+ { type : PartType . ENV_VARIABLE , name : 'foo' , value : 'bar=baz' , source : undefined } ,
133135 { type : PartType . TEXT , text : ' ' , source : undefined } ,
134136 {
135137 type : PartType . PLUGIN ,
@@ -171,34 +173,38 @@ describe('parser', (): void => {
171173 ] ) ;
172174 } ) ;
173175 it ( 'semantic markup test (with source)' , ( ) : void => {
174- expect ( parse ( 'foo E(a\\),b) P(foo.bar.baz#bam) baz V( b\\,\\na\\)\\\\m\\, ) O(foo) ' , { addSource : true } ) ) . toEqual (
175- [
176- [
177- { type : PartType . TEXT , text : 'foo ' , source : 'foo ' } ,
178- { type : PartType . ENV_VARIABLE , name : 'a),b' , source : 'E(a\\),b)' } ,
179- { type : PartType . TEXT , text : ' ' , source : ' ' } ,
180- {
181- type : PartType . PLUGIN ,
182- plugin : { fqcn : 'foo.bar.baz' , type : 'bam' } ,
183- entrypoint : undefined ,
184- source : 'P(foo.bar.baz#bam)' ,
185- } ,
186- { type : PartType . TEXT , text : ' baz ' , source : ' baz ' } ,
187- { type : PartType . OPTION_VALUE , value : ' b,na)\\m, ' , source : 'V( b\\,\\na\\)\\\\m\\, )' } ,
188- { type : PartType . TEXT , text : ' ' , source : ' ' } ,
189- {
190- type : PartType . OPTION_NAME ,
191- plugin : undefined ,
192- entrypoint : undefined ,
193- link : [ 'foo' ] ,
194- name : 'foo' ,
195- value : undefined ,
196- source : 'O(foo)' ,
197- } ,
198- { type : PartType . TEXT , text : ' ' , source : ' ' } ,
199- ] ,
176+ expect (
177+ parse ( 'foo E(a\\),b) E(foo=bar=baz) P(foo.bar.baz#bam) baz V( b\\,\\na\\)\\\\m\\, ) O(foo) ' , {
178+ addSource : true ,
179+ } ) ,
180+ ) . toEqual ( [
181+ [
182+ { type : PartType . TEXT , text : 'foo ' , source : 'foo ' } ,
183+ { type : PartType . ENV_VARIABLE , name : 'a),b' , value : undefined , source : 'E(a\\),b)' } ,
184+ { type : PartType . TEXT , text : ' ' , source : ' ' } ,
185+ { type : PartType . ENV_VARIABLE , name : 'foo' , value : 'bar=baz' , source : 'E(foo=bar=baz)' } ,
186+ { type : PartType . TEXT , text : ' ' , source : ' ' } ,
187+ {
188+ type : PartType . PLUGIN ,
189+ plugin : { fqcn : 'foo.bar.baz' , type : 'bam' } ,
190+ entrypoint : undefined ,
191+ source : 'P(foo.bar.baz#bam)' ,
192+ } ,
193+ { type : PartType . TEXT , text : ' baz ' , source : ' baz ' } ,
194+ { type : PartType . OPTION_VALUE , value : ' b,na)\\m, ' , source : 'V( b\\,\\na\\)\\\\m\\, )' } ,
195+ { type : PartType . TEXT , text : ' ' , source : ' ' } ,
196+ {
197+ type : PartType . OPTION_NAME ,
198+ plugin : undefined ,
199+ entrypoint : undefined ,
200+ link : [ 'foo' ] ,
201+ name : 'foo' ,
202+ value : undefined ,
203+ source : 'O(foo)' ,
204+ } ,
205+ { type : PartType . TEXT , text : ' ' , source : ' ' } ,
200206 ] ,
201- ) ;
207+ ] ) ;
202208 expect ( parse ( 'P(foo.bar.baz#role) P(foo.bar.baz#role:entrypoint)' ) ) . toEqual ( [
203209 [
204210 {
0 commit comments