Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add test case for panics for invalid namespaced function expressions #383

Merged
merged 6 commits into from
Apr 5, 2024
Prev Previous commit
fix test for hover data on invalid code
  • Loading branch information
ansgarm committed Apr 5, 2024
commit a811b535473e0101239cafc552e0917c51f7fdaa
11 changes: 5 additions & 6 deletions decoder/hover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,15 +677,14 @@ func TestDecoder_HoverAtPos_nil_expr(t *testing.T) {
})

ctx := context.Background()
_, err := d.HoverAtPos(ctx, "test.tf", hcl.Pos{Line: 1, Column: 16, Byte: 15})
hoverData, err := d.HoverAtPos(ctx, "test.tf", hcl.Pos{Line: 1, Column: 16, Byte: 15})

if err == nil {
t.Fatal("expected error")
if err != nil {
t.Fatal(err)
}

positionalErr := &PositionalError{}
if !errors.As(err, &positionalErr) {
t.Fatal("expected PositionalError for invalid expression")
if hoverData != nil {
t.Fatalf("expected nil hover data, got: %v", hoverData)
}
}

Expand Down
Loading