Skip to content

Commit

Permalink
Fix Go diagnostics tests to work on both Go 1.19 and 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
fhs committed Jun 18, 2023
1 parent 286f10f commit 5e36ee4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/lsp/acmelsp/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"reflect"
"regexp"
"runtime"
"strings"
"testing"
Expand Down Expand Up @@ -311,9 +312,9 @@ func main() {
}

diag := <-ch
want := "s declared and not used"
if diag.Message != want {
t.Errorf("diagnostics message is %q, want %q", diag.Message, want)
pat := regexp.MustCompile("^s declared (and|but) not used$")
if !pat.MatchString(diag.Message) {
t.Errorf("diagnostics message is %q does not match %q", diag.Message, pat)
}

err = lsp.DidClose(ctx, srv.Client, gofile)
Expand Down

0 comments on commit 5e36ee4

Please sign in to comment.