@@ -113,6 +113,11 @@ func TestFormat(t *testing.T) {
113113 },
114114 expected : "Example is: {123 This is a test str, nothing more special -1.098743 main question error, is 42}" ,
115115 },
116+ "open bracket at the end of line of go file" : {
117+ template : "type serviceHealth struct {" ,
118+ args : []any {},
119+ expected : "type serviceHealth struct {" ,
120+ },
116121 } {
117122 t .Run (name , func (t * testing.T ) {
118123 assert .Equal (t , test .expected , stringFormatter .Format (test .template , test .args ... ))
@@ -192,6 +197,11 @@ func TestFormatComplex(t *testing.T) {
192197 args : map [string ]any {"ipaddr" : "127.0.0.1" , "port" : 5432 , "ssl" : false },
193198 expected : "Current app settings are: ipAddr: 127.0.0.1, port: 5432, use ssl: false." ,
194199 },
200+ "one json line with open bracket at the end" : {
201+ template : " \" server\" : {" ,
202+ args : map [string ]any {},
203+ expected : " \" server\" : {" ,
204+ },
195205 } {
196206 t .Run (name , func (t * testing.T ) {
197207 assert .Equal (t , test .expected , stringFormatter .FormatComplex (test .template , test .args ))
0 commit comments