Ai
1 Star 0 Fork 0

麦冬果果/graphql-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
scalars_parsevalue_test.go 674 Bytes
一键复制 编辑 原始数据 按行查看 历史
package graphql_test
import (
"reflect"
"testing"
"time"
"github.com/graphql-go/graphql"
)
func TestTypeSystem_Scalar_ParseValueOutputDateTime(t *testing.T) {
t1, _ := time.Parse(time.RFC3339, "2017-07-23T03:46:56.647Z")
tests := []dateTimeSerializationTest{
{nil, nil},
{"", nil},
{(*string)(nil), nil},
{"2017-07-23", nil},
{"2017-07-23T03:46:56.647Z", t1},
}
for _, test := range tests {
val := graphql.DateTime.ParseValue(test.Value)
if val != test.Expected {
reflectedValue := reflect.ValueOf(test.Value)
t.Fatalf("failed DateTime.ParseValue(%v(%v)), expected: %v, got %v", reflectedValue.Type(), test.Value, test.Expected, val)
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdgg0816/graphql-go.git
git@gitee.com:mdgg0816/graphql-go.git
mdgg0816
graphql-go
graphql-go
v0.7.6

搜索帮助