From b57a5b379c3afd39d8f1cd4833e265a2a7c9c9c8 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Mon, 4 Sep 2023 15:34:57 +0100 Subject: [PATCH] validations: add test for disabled origins --- .../validations/unreferenced_origin_test.go | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/internal/decoder/validations/unreferenced_origin_test.go b/internal/decoder/validations/unreferenced_origin_test.go index f36b6122..2f0457a9 100644 --- a/internal/decoder/validations/unreferenced_origin_test.go +++ b/internal/decoder/validations/unreferenced_origin_test.go @@ -50,6 +50,28 @@ func TestUnreferencedOrigins(t *testing.T) { }, }, }, + { + name: "unsupported path origins (module input)", + origins: reference.Origins{ + reference.PathOrigin{ + Range: hcl.Range{ + Filename: "test.tf", + Start: hcl.Pos{}, + End: hcl.Pos{}, + }, + TargetAddr: lang.Address{ + lang.RootStep{Name: "var"}, + lang.AttrStep{Name: "foo"}, + }, + TargetPath: lang.Path{ + Path: "./submodule", + LanguageID: "terraform", + }, + Constraints: reference.OriginConstraints{}, + }, + }, + want: lang.DiagnosticsMap{}, + }, { name: "many undeclared variables", origins: reference.Origins{