github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/utils/json/lazy_test.go (about) 1 package json_test 2 3 import ( 4 "testing" 5 6 "github.com/lmorg/murex/test/count" 7 "github.com/lmorg/murex/utils/json" 8 ) 9 10 func TestLazyLogging(t *testing.T) { 11 count.Tests(t, 3) 12 13 act := json.LazyLogging(nil) 14 if act != "null" { 15 t.Errorf("Actual != 'null': %s", act) 16 } 17 18 act = json.LazyLogging(3) 19 if act != "3" { 20 t.Errorf("Actual != 3 : %s", act) 21 } 22 23 act = json.LazyLogging("foobar") 24 if act != `"foobar"` { 25 t.Errorf(`Actual != '"foobar"' : %s`, act) 26 } 27 }