(t *testing.T)
| 2918 | } |
| 2919 | |
| 2920 | func TestStaticExpressionList(t *testing.T) { |
| 2921 | expr, _ := ParseExpression([]byte("[0, a, true]"), "", hcl.Pos{}) |
| 2922 | exprs, diags := hcl.ExprList(expr) |
| 2923 | if len(diags) != 0 { |
| 2924 | t.Fatalf("unexpected diagnostics:\n%s", diags.Error()) |
| 2925 | } |
| 2926 | if len(exprs) != 3 { |
| 2927 | t.Fatalf("wrong result %#v; want length 3", exprs) |
| 2928 | } |
| 2929 | first, ok := exprs[0].(*LiteralValueExpr) |
| 2930 | if !ok { |
| 2931 | t.Fatalf("first expr has wrong type %T; want *hclsyntax.LiteralValueExpr", exprs[0]) |
| 2932 | } |
| 2933 | if !first.Val.RawEquals(cty.Zero) { |
| 2934 | t.Fatalf("wrong first value %#v; want cty.Zero", first.Val) |
| 2935 | } |
| 2936 | } |
| 2937 | |
| 2938 | // Check that function call w/ incomplete argument still reports correct range |
| 2939 | func TestParseExpression_incompleteFunctionCall(t *testing.T) { |
nothing calls this directly
no test coverage detected