@@ -199,6 +199,17 @@ suite('ConfigurationModel', () => {
199199 assert . deepEqual ( result . keys , [ 'a.b' , 'f' ] ) ;
200200 } ) ;
201201
202+ test ( 'merge overrides when frozen' , ( ) => {
203+ let model1 = new ConfigurationModel ( { 'a' : { 'b' : 1 } , 'f' : 1 } , [ 'a.b' , 'f' ] , [ { identifiers : [ 'c' ] , contents : { 'a' : { 'd' : 1 } } } ] ) . freeze ( ) ;
204+ let model2 = new ConfigurationModel ( { 'a' : { 'b' : 2 } } , [ 'a.b' ] , [ { identifiers : [ 'c' ] , contents : { 'a' : { 'e' : 2 } } } ] ) . freeze ( ) ;
205+ let result = new ConfigurationModel ( ) . merge ( model1 , model2 ) ;
206+
207+ assert . deepEqual ( result . contents , { 'a' : { 'b' : 2 } , 'f' : 1 } ) ;
208+ assert . deepEqual ( result . overrides , [ { identifiers : [ 'c' ] , contents : { 'a' : { 'd' : 1 , 'e' : 2 } } } ] ) ;
209+ assert . deepEqual ( result . override ( 'c' ) . contents , { 'a' : { 'b' : 2 , 'd' : 1 , 'e' : 2 } , 'f' : 1 } ) ;
210+ assert . deepEqual ( result . keys , [ 'a.b' , 'f' ] ) ;
211+ } ) ;
212+
202213 test ( 'Test contents while getting an existing property' , ( ) => {
203214 let testObject = new ConfigurationModel ( { 'a' : 1 } ) ;
204215 assert . deepEqual ( testObject . getValue ( 'a' ) , 1 ) ;
@@ -349,24 +360,6 @@ suite('CustomConfigurationModel', () => {
349360 } ) ;
350361 assert . equal ( true , new DefaultConfigurationModel ( ) . getValue ( 'a' ) ) ;
351362 } ) ;
352-
353- test ( 'Test registering the language property' , ( ) => {
354- Registry . as < IConfigurationRegistry > ( Extensions . Configuration ) . registerConfiguration ( {
355- 'id' : '[a]' ,
356- 'order' : 1 ,
357- 'title' : 'a' ,
358- 'type' : 'object' ,
359- 'properties' : {
360- '[a]' : {
361- 'description' : 'a' ,
362- 'type' : 'boolean' ,
363- 'default' : false ,
364- }
365- }
366- } ) ;
367- assert . equal ( undefined , new DefaultConfigurationModel ( ) . getValue ( '[a]' ) ) ;
368- } ) ;
369-
370363} ) ;
371364
372365suite ( 'ConfigurationChangeEvent' , ( ) => {
0 commit comments