package snapshot import ( "errors" "testing" ) func TestPrimatives(t *testing.T) { cases := map[string]any{ "string": "I am a snapshot.\nA string snapshot, to be sure.\nCan you read me now?", "string-with-escapes": "strval\nwith\t\"escapes\"", "bool": true, "int": int(93), "int8": int8(93), "int16": int16(93), "int32": int32(93), "int64": int64(93), "int-negative": int(-93), "int8-negative": int8(-93), "int16-negative": int16(-93), "int32-negative": int32(-93), "int64-negative": int64(-93), "uint": uint(93), "uint8": uint8(93), "uint16": uint16(93), "uint32": uint32(93), "uint64": uint64(93), "uintptr": uintptr(93), "float32": float32(93.75), "float64": float64(93.75), "complex64": complex64(93i), //expected: "(0+93i)" "complex128": complex128(93i), //expected: "(0+93i)" "error": errors.New("I am an error"), } for test, tc := range cases { t.Run(test, func(t *testing.T) { Snap(t, tc) }) } }