From 09c09a96216fabcd5de74051c28decfd08affb36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 1 Nov 2024 18:35:00 +0800 Subject: [PATCH] code clenup --- run_test.go | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/run_test.go b/run_test.go index b78e031..66d8056 100644 --- a/run_test.go +++ b/run_test.go @@ -8,48 +8,18 @@ package validator import ( - "encoding/json" "fmt" "git.zhangdeman.cn/gateway/validator/define" "github.com/stretchr/testify/assert" - "github.com/tidwall/gjson" "testing" ) -func TestRun(t *testing.T) { - sourceData := map[string]interface{}{ - "name": "白茶清欢", - } - _ = Run(sourceData, nil, nil) - byteData, _ := json.Marshal(sourceData) - fmt.Println(string(byteData)) -} - -func Test_getDataStatus(t *testing.T) { - type args struct { - val gjson.Result - dataType string - } - tests := []struct { - name string - args args - want string - }{ - // TODO: Add test cases. - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - assert.Equalf(t, tt.want, getDataStatus(tt.args.val, tt.args.dataType), "getDataStatus(%v, %v)", tt.args.val, tt.args.dataType) - }) - } -} - -// TestRunRequired 测试字段必传 +// TestRunString 测试字符串类型 // // Author : go_developer@163.com<白茶清欢> // // Date : 16:48 2024/11/1 -func TestRunRequired(t *testing.T) { +func TestRunString(t *testing.T) { sourceData := map[string]interface{}{ "name": "白茶清欢", }