Esempio n. 1
0
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))
}
Esempio n. 2
0
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))
}