2
0

status_test.go 464 B

1234567891011121314151617181920212223
  1. package internal
  2. import (
  3. "encoding/json"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestSyncStatus(t *testing.T) {
  8. Convey("SyncStatus json ser-de should work", t, func() {
  9. b, err := json.Marshal(PreSyncing)
  10. So(err, ShouldBeNil)
  11. So(b, ShouldResemble, []byte(`"pre-syncing"`)) // deep equal should be used
  12. var s SyncStatus
  13. err = json.Unmarshal([]byte(`"failed"`), &s)
  14. So(err, ShouldBeNil)
  15. So(s, ShouldEqual, Failed)
  16. })
  17. }