(t *testing.T)
| 585 | } |
| 586 | |
| 587 | func TestCompletion_WSL(t *testing.T) { |
| 588 | testCases := []struct { |
| 589 | name string |
| 590 | content string |
| 591 | dockerfileContent string |
| 592 | line uint32 |
| 593 | character uint32 |
| 594 | items []protocol.CompletionItem |
| 595 | }{ |
| 596 | { |
| 597 | name: "target attribute in target block", |
| 598 | content: "target \"api\" {\n target = \"\"\n}", |
| 599 | line: 1, |
| 600 | dockerfileContent: "", |
| 601 | character: 12, |
| 602 | items: []protocol.CompletionItem{ |
| 603 | { |
| 604 | Label: "base", |
| 605 | }, |
| 606 | { |
| 607 | Label: "tests", |
| 608 | }, |
| 609 | { |
| 610 | Label: "release", |
| 611 | }, |
| 612 | }, |
| 613 | }, |
| 614 | { |
| 615 | name: "args keys in target block", |
| 616 | content: "target \"api\" {\n args = {\n \"blah\" = \"\"\n }\n}", |
| 617 | line: 2, |
| 618 | dockerfileContent: "", |
| 619 | character: 5, |
| 620 | items: []protocol.CompletionItem{ |
| 621 | { |
| 622 | Label: "TARGETOS", |
| 623 | }, |
| 624 | { |
| 625 | Label: "TARGETARCH", |
| 626 | }, |
| 627 | { |
| 628 | Label: "argOne", |
| 629 | }, |
| 630 | { |
| 631 | Label: "argTwo", |
| 632 | }, |
| 633 | { |
| 634 | Label: "argOnePredefined", |
| 635 | }, |
| 636 | }, |
| 637 | }, |
| 638 | { |
| 639 | name: "resolve build stage targets from a Dockerfile inside a context folder", |
| 640 | content: "target \"backend\" {\n context = \"./backend\"\n target=\"\"\n}", |
| 641 | line: 2, |
| 642 | character: 10, |
| 643 | items: []protocol.CompletionItem{ |
| 644 | { |
nothing calls this directly
no test coverage detected