(t *testing.T, testsFolder, uriString string)
| 26 | } |
| 27 | |
| 28 | func testCodeLens(t *testing.T, testsFolder, uriString string) { |
| 29 | testCases := []struct { |
| 30 | name string |
| 31 | content string |
| 32 | codeLens []protocol.CodeLens |
| 33 | }{ |
| 34 | { |
| 35 | name: "empty file", |
| 36 | content: "", |
| 37 | codeLens: []protocol.CodeLens{}, |
| 38 | }, |
| 39 | { |
| 40 | name: "target block with no label", |
| 41 | content: "target {}", |
| 42 | codeLens: []protocol.CodeLens{}, |
| 43 | }, |
| 44 | { |
| 45 | name: "target block", |
| 46 | content: "target \"first\" { target = \"abc\"\n}", |
| 47 | codeLens: []protocol.CodeLens{ |
| 48 | { |
| 49 | Command: &protocol.Command{ |
| 50 | Title: "Build", |
| 51 | Command: types.BakeBuildCommandId, |
| 52 | Arguments: []any{ |
| 53 | map[string]string{ |
| 54 | "call": "build", |
| 55 | "target": "first", |
| 56 | "cwd": testsFolder, |
| 57 | }, |
| 58 | }, |
| 59 | }, |
| 60 | Range: protocol.Range{ |
| 61 | Start: protocol.Position{Line: 0}, |
| 62 | End: protocol.Position{Line: 0}, |
| 63 | }, |
| 64 | }, |
| 65 | { |
| 66 | Command: &protocol.Command{ |
| 67 | Title: "Check", |
| 68 | Command: types.BakeBuildCommandId, |
| 69 | Arguments: []any{ |
| 70 | map[string]string{ |
| 71 | "call": "check", |
| 72 | "target": "first", |
| 73 | "cwd": testsFolder, |
| 74 | }, |
| 75 | }, |
| 76 | }, |
| 77 | Range: protocol.Range{ |
| 78 | Start: protocol.Position{Line: 0}, |
| 79 | End: protocol.Position{Line: 0}, |
| 80 | }, |
| 81 | }, |
| 82 | { |
| 83 | Command: &protocol.Command{ |
| 84 | Title: "Print", |
| 85 | Command: types.BakeBuildCommandId, |
no test coverage detected