Skip to content

Commit

Permalink
go.mod: update to go 1.22.1 (#743)
Browse files Browse the repository at this point in the history
Our CI pipeline uses apline:edge which now ship with 1.22. I noticed
that matchree_test.go doesn't pass anymore. There seem to have been
changes in regex package which we catch in our tests.

test plan:
go test ./... and CI

Co-authored-by: Keegan Carruthers-Smith <[email protected]>
  • Loading branch information
stefanhengl and keegancsmith authored Mar 12, 2024
1 parent 755d68b commit 52a28e3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ jobs:
fuzz-test:
name: fuzz test
runs-on: ubuntu-latest
container: alpine:edge
steps:
- name: add dependencies
run: apk add bash go
# Pinned a commit to make go version configurable.
# This should be safe to upgrade once this commit is in a released version:
# https://github.com/jidicula/go-fuzz-action/commit/23cc553941669144159507e2cccdbb4afc5b3076
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
golang 1.21.2
golang 1.22.1
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

go 1.21
go 1.22
2 changes: 1 addition & 1 deletion matchtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ func (d *indexData) newMatchTree(q query.Q, opt matchTreeOpt) (matchTree, error)

return &symbolRegexpMatchTree{
regexp: regexp,
all: regexp.String() == "(?i)(?-s:.)*",
all: regexp.String() == "(?i)(?-s:.*)",
matchTree: subMT,
}, nil

Expand Down
4 changes: 2 additions & 2 deletions matchtree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ func TestSymbolMatchTree(t *testing.T) {
regex string
regexAll bool
}{
{query: "sym:.*", regex: "(?i)(?-s:.)*", regexAll: true},
{query: "sym:.*", regex: "(?i)(?-s:.*)", regexAll: true},
{query: "sym:(ab|cd)", regex: "(?i)ab|cd"},
{query: "sym:b.r", regex: "(?i)b(?-s:.)r"},
{query: "sym:b.r", regex: "(?i)(?-s:b.r)"},
{query: "sym:horse", substr: "horse"},
{query: `sym:\bthread\b case:yes`, regex: `\bthread\b`}, // check we disable word search opt
{query: `sym:\bthread\b case:no`, regex: `(?i)\bthread\b`},
Expand Down

0 comments on commit 52a28e3

Please sign in to comment.