mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-21 10:06:58 +00:00
Have own HAR library code (#695)
This commit is contained in:
26
agent/pkg/oas/tree_test.go
Normal file
26
agent/pkg/oas/tree_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user