镜像自地址
https://github.com/tuna/tunasync.git
已同步 2025-12-06 06:26:46 +00:00
refactor: moved mirrorStatus back to manager
这个提交包含在:
23
internal/status_test.go
普通文件
23
internal/status_test.go
普通文件
@@ -0,0 +1,23 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
func TestSyncStatus(t *testing.T) {
|
||||
Convey("SyncStatus json ser-de should work", t, func() {
|
||||
|
||||
b, err := json.Marshal(PreSyncing)
|
||||
So(err, ShouldBeNil)
|
||||
So(b, ShouldResemble, []byte(`"pre-syncing"`)) // deep equal should be used
|
||||
|
||||
var s SyncStatus
|
||||
|
||||
err = json.Unmarshal([]byte(`"failed"`), &s)
|
||||
So(err, ShouldBeNil)
|
||||
So(s, ShouldEqual, Failed)
|
||||
})
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户