Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpogran committed Mar 20, 2023
1 parent 0eb4e3f commit 2d69894
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions decoder/expr_type_declaration_completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,45 @@ func TestCompletionAtPos_exprTypeDeclaration(t *testing.T) {
hcl.Pos{Line: 1, Column: 12, Byte: 11},
lang.CompleteCandidates([]lang.Candidate{}),
},
{
"single-line new element inside key name with no equal sign",
map[string]*schema.AttributeSchema{
"attr": {
Constraint: schema.TypeDeclaration{},
},
},
`attr = { foo }
`,
hcl.Pos{Line: 1, Column: 11, Byte: 10},
lang.CompleteCandidates([]lang.Candidate{}),
},
{
"single-line new element value after equal sign",
map[string]*schema.AttributeSchema{
"attr": {
Constraint: schema.TypeDeclaration{},
},
},
`attr = { foo = }
`,
hcl.Pos{Line: 1, Column: 16, Byte: 15},
lang.CompleteCandidates([]lang.Candidate{
{
Label: `kw`,
Detail: "keyword",
TextEdit: lang.TextEdit{
Range: hcl.Range{
Filename: "test.tf",
Start: hcl.Pos{Line: 1, Column: 16, Byte: 15},
End: hcl.Pos{Line: 1, Column: 16, Byte: 15},
},
NewText: `kw`,
Snippet: `kw`,
},
Kind: lang.KeywordCandidateKind,
},
}),
},
{
"single-line object value",
map[string]*schema.AttributeSchema{
Expand Down

0 comments on commit 2d69894

Please sign in to comment.