A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

32 lines
574 B

  1. package writefreely
  2. import (
  3. "testing"
  4. "github.com/writeas/web-core/activitystreams"
  5. )
  6. var actorTestTable = []struct {
  7. Name string
  8. Resp []byte
  9. }{
  10. {
  11. "Context as a string",
  12. []byte(`{"@context":"https://www.w3.org/ns/activitystreams"}`),
  13. },
  14. {
  15. "Context as a list",
  16. []byte(`{"@context":["one string", "two strings"]}`),
  17. },
  18. }
  19. func TestUnmarshalActor(t *testing.T) {
  20. for _, tc := range actorTestTable {
  21. actor := activitystreams.Person{}
  22. err := unmarshalActor(tc.Resp, &actor)
  23. if err != nil {
  24. t.Errorf("%s failed with error %s", tc.Name, err)
  25. }
  26. }
  27. }