23 lines
419 B
Go
23 lines
419 B
Go
package repository
|
|
|
|
import (
|
|
"google.golang.org/protobuf/proto"
|
|
proto2 "joylink.club/rtsssimulation/repository/model/proto"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestBuildRepository(t *testing.T) {
|
|
bytes, err := os.ReadFile("./repo.bin")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
source := &proto2.Repository{}
|
|
err = proto.Unmarshal(bytes, source)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
repo, err := BuildRepository(source)
|
|
println(repo)
|
|
}
|