MCPcopy
hub / github.com/hashicorp/hcl / TestExpressionAsTraversal

Function TestExpressionAsTraversal

json/structure_test.go:1329–1339  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1327}
1328
1329func TestExpressionAsTraversal(t *testing.T) {
1330 e := &expression{
1331 src: &stringVal{
1332 Value: "foo.bar[0]",
1333 },
1334 }
1335 traversal := e.AsTraversal()
1336 if len(traversal) != 3 {
1337 t.Fatalf("incorrect traversal %#v; want length 3", traversal)
1338 }
1339}
1340
1341func TestStaticExpressionList(t *testing.T) {
1342 e := &expression{

Callers

nothing calls this directly

Calls 1

AsTraversalMethod · 0.95

Tested by

no test coverage detected