Skip to content

Commit a70f2bc

Browse files
committed
gopls/internal/regtest/misc: update and unskip TestHoverIntLiteral
This test is updated to exercise hover over literals, not vars, as was decided in golang/go#58220. Updates golang/go#53878 Change-Id: Ic70d3492f28580ebfea24ec08dc47b1ad385c2ff Reviewed-on: https://go-review.googlesource.com/c/tools/+/496885 Run-TryBot: Robert Findley <[email protected]> Reviewed-by: Alan Donovan <[email protected]> gopls-CI: kokoro <[email protected]> Auto-Submit: Robert Findley <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 6997d19 commit a70f2bc

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

gopls/internal/regtest/misc/hover_test.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ func main() {
8484
}
8585

8686
func TestHoverIntLiteral(t *testing.T) {
87-
// TODO(rfindley): this behavior doesn't actually make sense for vars. It is
88-
// misleading to format their value when it is (of course) variable.
89-
//
90-
// Instead, we should allow hovering on numeric literals.
91-
t.Skip("golang/go#58220: broken due to new hover logic")
92-
9387
const source = `
9488
-- main.go --
9589
package main
@@ -106,13 +100,13 @@ func main() {
106100
Run(t, source, func(t *testing.T, env *Env) {
107101
env.OpenFile("main.go")
108102
hexExpected := "58190"
109-
got, _ := env.Hover(env.RegexpSearch("main.go", "hex"))
103+
got, _ := env.Hover(env.RegexpSearch("main.go", "0xe"))
110104
if got != nil && !strings.Contains(got.Value, hexExpected) {
111105
t.Errorf("Hover: missing expected field '%s'. Got:\n%q", hexExpected, got.Value)
112106
}
113107

114108
binExpected := "73"
115-
got, _ = env.Hover(env.RegexpSearch("main.go", "bigBin"))
109+
got, _ = env.Hover(env.RegexpSearch("main.go", "0b1"))
116110
if got != nil && !strings.Contains(got.Value, binExpected) {
117111
t.Errorf("Hover: missing expected field '%s'. Got:\n%q", binExpected, got.Value)
118112
}

0 commit comments

Comments
 (0)