committed by
Thomas Pelletier
parent
19ece5dc77
commit
878c11e70e
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
@@ -508,6 +509,14 @@ func TestPointerUnmarshal(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnmarshalTypeMismatch(t *testing.T) {
|
||||
result := pointerMarshalTestStruct{}
|
||||
err := Unmarshal([]byte("List = 123"), &result)
|
||||
if !strings.HasPrefix(err.Error(), "(1, 1): Can't convert 123(int64) to []string(slice)") {
|
||||
t.Errorf("Type mismatch must be reported: got %v", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
type nestedMarshalTestStruct struct {
|
||||
String [][]string
|
||||
//Struct [][]basicMarshalTestSubStruct
|
||||
|
||||
Reference in New Issue
Block a user