-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add m3ninx query prop tests #885
Conversation
Codecov Report
@@ Coverage Diff @@
## master #885 +/- ##
===========================================
+ Coverage 55.8% 78.73% +22.92%
===========================================
Files 392 397 +5
Lines 33328 33523 +195
===========================================
+ Hits 18599 26394 +7795
+ Misses 13067 5317 -7750
- Partials 1662 1812 +150
Continue to review full report at Codecov.
|
4c2fc94
to
e6506fd
Compare
a8d2f77
to
91d80d0
Compare
src/m3ninx/index/regexp.go
Outdated
) | ||
|
||
// CompileRegex compiles the provided regexp. | ||
func CompileRegex(r []byte) (CompiledRegex, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey as we briefly discussed, could we instead use validation and just ensure that callers have fully anchored their regexps?
It is more explicit that way, rather than coercing their regexps into being fully anchored.
I don't mind too much either way, but that seems less magical just responding with an error saying "hey please fully anchor your regexp with "^pattern$".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in #902
2883443
to
2cf04be
Compare
return nil, errReaderNilRegex | ||
} | ||
|
||
pl, err := r.segment.matchRegexp(field, compileRE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Instead perhaps just return r.segment.matchRegexp(field, compileRE)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
src/m3ninx/index/regexp.go
Outdated
@@ -0,0 +1,62 @@ | |||
// Copyright (c) 2017 Uber Technologies, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
91d80d0
to
26f4ff7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
simpleSeg := newTestMemSegment(t, lotsTestDocuments) | ||
fstSeg := fst.ToTestSegment(t, simpleSeg, fstOptions) | ||
|
||
properties.Property("Simple & FST Segments Query the same results", prop.ForAll( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice, this is pretty great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
4feeba8
to
004910f
Compare
2528c57
to
47d648f
Compare
Pending: