1 Star 0 Fork 0

橙子/proto

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
protobuf_test.go 991 Bytes
一键复制 编辑 原始数据 按行查看 历史
Ernest Micklei 提交于 2018-05-12 07:54 . fixes for issue #86 (#87)
package proto
import (
"net/http"
"os"
"testing"
)
func fetchAndParse(t *testing.T, url string) *Proto {
resp, err := http.Get(url)
if err != nil {
t.Fatal(url, err)
}
defer resp.Body.Close()
parser := NewParser(resp.Body)
def, err := parser.Parse()
if err != nil {
t.Fatal(url, err)
}
t.Log("elements:", len(def.Elements))
return def
}
// PB=y go test -v -run ^TestPublicProtoDefinitions$
func TestPublicProtoDefinitions(t *testing.T) {
if len(os.Getenv("PB")) == 0 {
t.Skip("PB test not run")
}
for _, each := range []string{
"https://raw.githubusercontent.com/gogo/protobuf/master/test/thetest.proto",
"https://raw.githubusercontent.com/gogo/protobuf/master/test/theproto3/theproto3.proto",
"https://raw.githubusercontent.com/googleapis/googleapis/master/google/privacy/dlp/v2/dlp.proto",
// "https://raw.githubusercontent.com/envoyproxy/data-plane-api/master/envoy/api/v2/auth/cert.proto",
} {
def := fetchAndParse(t, each)
checkParent(def, t)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xuchengzhi/proto-emicklei.git
[email protected]:xuchengzhi/proto-emicklei.git
xuchengzhi
proto-emicklei
proto
master

搜索帮助