@@ -36,26 +36,23 @@ func TestCHSettingsVersionFiltering(t *testing.T) {
3636 require .Equal (t , chproto.Version {Major : 25 , Minor : 8 , Patch : 0 }, minVersion )
3737 chSettings := NewCHSettings (& chproto.Version {Major : 25 , Minor : 8 , Patch : 0 })
3838 chSettings .Add (SettingJsonTypeEscapeDotsInKeys , "1" )
39- result := chSettings .String ()
40- require .Equal (t , " SETTINGS json_type_escape_dots_in_keys=1" , result )
39+ require .Equal (t , " SETTINGS json_type_escape_dots_in_keys=1" , chSettings .String ())
4140
4241 // setting not meeting minimum version should be filter out
4342 chSettings = NewCHSettings (& chproto.Version {Major : 25 , Minor : 7 , Patch : 0 })
4443 chSettings .Add (SettingJsonTypeEscapeDotsInKeys , "1" )
45- result = chSettings .String ()
46- require .Empty (t , result )
44+ require .Empty (t , chSettings .String ())
4745
4846 // settings not having minimum version should be included
4947 _ , minVersionExist := GetMinVersion (SettingThrowOnMaxPartitionsPerInsertBlock )
5048 require .False (t , minVersionExist )
51- result = NewCHSettingsString (& chproto.Version {Major : 25 , Minor : 8 , Patch : 0 },
52- CHSettingEntry {SettingThrowOnMaxPartitionsPerInsertBlock , "0" })
53- require .Equal (t , " SETTINGS throw_on_max_partitions_per_insert_block=0" , result )
49+ require .Equal (t , " SETTINGS throw_on_max_partitions_per_insert_block=0" ,
50+ NewCHSettingsString (& chproto.Version {Major : 25 , Minor : 8 , Patch : 0 }, SettingThrowOnMaxPartitionsPerInsertBlock , "0" ))
5451
5552 // setting should be included when ch version is not specified
56- result = NewCHSettingsString (nil ,
57- CHSettingEntry { SettingJsonTypeEscapeDotsInKeys , "1" },
58- CHSettingEntry { SettingThrowOnMaxPartitionsPerInsertBlock , "0" },
59- )
60- require . Equal ( t , " SETTINGS json_type_escape_dots_in_keys=1, throw_on_max_partitions_per_insert_block=0" , result )
53+ chSettings = NewCHSettings (nil )
54+ chSettings . Add ( SettingJsonTypeEscapeDotsInKeys , "1" )
55+ chSettings . Add ( SettingThrowOnMaxPartitionsPerInsertBlock , "0" )
56+ require . Equal ( t , " SETTINGS json_type_escape_dots_in_keys=1, throw_on_max_partitions_per_insert_block=0" ,
57+ chSettings . String () )
6158}
0 commit comments