Have own HAR library code (#695)

This commit is contained in:
Andrey Pokhilko
2022-01-26 11:57:18 +03:00
committed by GitHub
parent 843ac722c9
commit 0c56c0f541
16 changed files with 526 additions and 105 deletions

View File

@@ -0,0 +1,26 @@
package oas
import (
"github.com/chanced/openapi"
"strings"
"testing"
)
func TestTree(t *testing.T) {
testCases := []struct {
inp string
}{
{"/"},
{"/v1.0.0/config/launcher/sp_nKNHCzsN/f34efcae-6583-11eb-908a-00b0fcb9d4f6/vendor,init,conversation"},
}
tree := new(Node)
for _, tc := range testCases {
split := strings.Split(tc.inp, "/")
node := tree.getOrSet(split, new(openapi.PathObj))
if node.constant == nil {
t.Errorf("nil constant: %s", tc.inp)
}
}
}