mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-21 21:12:34 +02:00

* chore: replace gopkg.in/yaml.v3 vs goccy/go-yaml; replace encoding/json with bytedance/sonic * fix: yaml unmarshal panic * feat: custom json marshaler implementation * chore: fix import and err marshal handling --------- Co-authored-by: yusing <yusing@6uo.me>
23 lines
508 B
Go
23 lines
508 B
Go
package middleware
|
|
|
|
import (
|
|
_ "embed"
|
|
"testing"
|
|
|
|
"github.com/yusing/go-proxy/pkg/json"
|
|
|
|
"github.com/yusing/go-proxy/internal/gperr"
|
|
. "github.com/yusing/go-proxy/internal/utils/testing"
|
|
)
|
|
|
|
//go:embed test_data/middleware_compose.yml
|
|
var testMiddlewareCompose []byte
|
|
|
|
func TestBuild(t *testing.T) {
|
|
errs := gperr.NewBuilder("")
|
|
middlewares := BuildMiddlewaresFromYAML("", testMiddlewareCompose, errs)
|
|
ExpectNoError(t, errs.Error())
|
|
json.Marshal(middlewares)
|
|
// t.Log(string(data))
|
|
// TODO: test
|
|
}
|