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

Function TestParse_nonObject

json/public_test.go:15–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestParse_nonObject(t *testing.T) {
16 src := `true`
17 file, diags := Parse([]byte(src), "")
18 if len(diags) != 1 {
19 t.Errorf("got %d diagnostics; want 1", len(diags))
20 }
21 if file == nil {
22 t.Fatalf("got nil File; want actual file")
23 }
24 if file.Body == nil {
25 t.Fatalf("got nil Body; want actual body")
26 }
27 if file.Body.(*body).val == nil {
28 t.Errorf("got nil Body object; want placeholder object")
29 }
30}
31
32func TestParseTemplate(t *testing.T) {
33 src := `{"greeting": "hello ${\"world\"}"}`

Callers

nothing calls this directly

Calls 1

ParseFunction · 0.85

Tested by

no test coverage detected