Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package archive
import (
"github.com/smartystreets/goconvey/convey"
"testing"
)
func Test_diff(t *testing.T) {
e1 := &EditHistory{
ArcHistory: &ArcHistory{Title: "haha"},
VHistory: []*VideoHistory{&VideoHistory{Filename: "hahah1"}, &VideoHistory{Filename: "hahah2"}},
}
var e2 *EditHistory
convey.Convey("diff between one and nil", t, func() {
diff, _ := e1.Diff(e2)
convey.So(diff, convey.ShouldEqual, e1)
})
e2 = &EditHistory{
ArcHistory: nil,
VHistory: []*VideoHistory{&VideoHistory{Filename: "hahah1"}},
}
convey.Convey("diff between 2 history", t, func() {
diff, _ := e1.Diff(e2)
convey.So(diff.ArcHistory.Title, convey.ShouldEqual, e1.ArcHistory.Title)
convey.So(len(diff.VHistory), convey.ShouldEqual, 1)
})
}