diff --git a/examples/plugin/main.go b/examples/plugin/main.go index af0bcd9d..a56466e2 100644 --- a/examples/plugin/main.go +++ b/examples/plugin/main.go @@ -1,5 +1,5 @@ -//go:build native -// +build native +//go:build !rpc +// +build !rpc package main diff --git a/pkg/kcl/api_test.go b/pkg/kcl/api_test.go index 574190bf..caa60f24 100644 --- a/pkg/kcl/api_test.go +++ b/pkg/kcl/api_test.go @@ -1,5 +1,5 @@ -//go:build native -// +build native +//go:build !rpc +// +build !rpc package kcl @@ -31,15 +31,6 @@ func TestNativeRun(t *testing.T) { fmt.Println(yaml) } -func ExampleNativeRunPaths() { - yaml := MustRunPaths([]string{"testdata/1.k", "testdata/2.k"}).GetRawYamlResult() - fmt.Println(yaml) - - // output: - // a: b - // c: d -} - func TestNativeRunWithPlugin(t *testing.T) { plugin.RegisterPlugin(plugin.Plugin{ Name: "my_plugin", diff --git a/pkg/service/rest_client_test.go b/pkg/service/rest_client_test.go index 561b97da..9573d9a0 100644 --- a/pkg/service/rest_client_test.go +++ b/pkg/service/rest_client_test.go @@ -6,23 +6,6 @@ import ( "kcl-lang.io/kcl-go/pkg/spec/gpyrpc" ) -func TestCallRestMethod_ping(t *testing.T) { - var args = gpyrpc.Ping_Args{Value: "ping"} - var result gpyrpc.Ping_Result - - var err = CallRestMethod( - "http://"+tRestServerAddr, "BuiltinService.Ping", - &args, &result, - ) - if err != nil { - t.Fatal(err) - } - - if result.Value != args.Value { - t.Fatalf("expect %q, got %q", args.Value, result.Value) - } -} - func TestCallRestMethod_noMethod(t *testing.T) { var args = gpyrpc.Ping_Args{Value: "ping"} var result gpyrpc.Ping_Result diff --git a/pkg/service/rest_server_test.go b/pkg/service/rest_server_test.go deleted file mode 100644 index 76ee31e0..00000000 --- a/pkg/service/rest_server_test.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright The KCL Authors. All rights reserved. - -package service - -import ( - "testing" - - "kcl-lang.io/kcl-go/pkg/spec/gpyrpc" -) - -func TestRestServer_ping(t *testing.T) { - var args = gpyrpc.Ping_Args{Value: "abc"} - var resp struct { - Error string `json:"error"` - Result gpyrpc.Ping_Result `json:"result"` - } - err := httpPost("http://"+tRestServerAddr+"/api:protorpc/BuiltinService.Ping", &args, &resp) - if err != nil { - t.Fatal(err) - } - if resp.Result.Value != args.Value { - t.Fatalf("expect = %v, got = %v", &args, &resp.Result) - } -}