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

Function TestParseExpression_incompleteFunctionCall

hclsyntax/expression_test.go:2939–3010  ·  view source on GitHub ↗

Check that function call w/ incomplete argument still reports correct range

(t *testing.T)

Source from the content-addressed store, hash-verified

2937
2938// Check that function call w/ incomplete argument still reports correct range
2939func TestParseExpression_incompleteFunctionCall(t *testing.T) {
2940 tests := []struct {
2941 cfg string
2942 expectedRange hcl.Range
2943 }{
2944 {
2945 `object({ foo = })`,
2946 hcl.Range{
2947 Filename: "test.hcl",
2948 Start: hcl.InitialPos,
2949 End: hcl.Pos{Line: 1, Column: 18, Byte: 17},
2950 },
2951 },
2952 {
2953 `object({
2954 foo =
2955})`,
2956 hcl.Range{
2957 Filename: "test.hcl",
2958 Start: hcl.InitialPos,
2959 End: hcl.Pos{Line: 3, Column: 3, Byte: 19},
2960 },
2961 },
2962 {
2963 `object({ foo = }`,
2964 hcl.Range{
2965 Filename: "test.hcl",
2966 Start: hcl.InitialPos,
2967 End: hcl.Pos{Line: 0, Column: 0, Byte: 0},
2968 },
2969 },
2970 {
2971 `object({
2972 foo =
2973}`,
2974 hcl.Range{
2975 Filename: "test.hcl",
2976 Start: hcl.InitialPos,
2977 End: hcl.Pos{Line: 0, Column: 0, Byte: 0},
2978 },
2979 },
2980 {
2981 `object({
2982 foo =
2983`,
2984 hcl.Range{
2985 Filename: "test.hcl",
2986 Start: hcl.InitialPos,
2987 End: hcl.Pos{Line: 0, Column: 0, Byte: 0},
2988 },
2989 },
2990 {
2991 `object({
2992 foo =
2993)`,
2994 hcl.Range{
2995 Filename: "test.hcl",
2996 Start: hcl.InitialPos,

Callers

nothing calls this directly

Calls 3

RunMethod · 0.80
ParseExpressionFunction · 0.70
RangeMethod · 0.65

Tested by

no test coverage detected