Changes
2 changed files (+20/-0)
-
-
@@ -282,6 +282,12 @@ func getAPLangRefField(data []byte, prop string) LangRef {return LangRef(val) } // UnmarshalJSON tries to detect the type of the object in the json data and then outputs a matching // ActivityStreams object, if possible func UnmarshalJSON(data []byte) (Item, error) { return unmarshalToAPObject(data), nil } /* func unmarshal(data []byte, a interface{}) (interface{}, error) { ta := make(mockObj, 0)
-
-
-
@@ -0,0 +1,14 @@package activitystreams import "testing" func TestUnmarshalJSON(t *testing.T) { dataEmpty := []byte("{}") i, err := UnmarshalJSON(dataEmpty) if err != nil { t.Errorf("invalid unmarshalling %s", err) } o := *i.(*Object) validateEmptyObject(o, t) }
-