func TestMarshalToFile_Failed(t *testing.T) { fn := path.Join(os.TempDir(), strconv.FormatInt(time.Now().UnixNano(), 16), "TestMarshalToFile.json") s := T{ S: "abc", } assert.Error(t, MarshalToFile(s, fn)) }
func TestUnmarshalFile_Failed(t *testing.T) { fn := path.Join(os.TempDir(), strconv.FormatInt(time.Now().UnixNano(), 16), "TestMarshalToFile.json") var s T assert.Error(t, UnmarshalFile(fn, &s)) }