-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increase test coverage and coerce inputs to string
Where possible, coerce inputs to strings with StringValue rather than raising a TypeError. This particularly impacts the relatively recent RE2::Set API which was excessively strict about its arguments. Add test coverage to all parts of the API, better covering edge cases including how encoding is handled based on the encoding of the RE2 pattern.
- Loading branch information
Showing
7 changed files
with
227 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
RSpec.describe Kernel do | ||
describe "#RE2" do | ||
describe ".RE2" do | ||
it "returns an RE2::Regexp instance given a pattern" do | ||
expect(RE2('w(o)(o)')).to be_a(RE2::Regexp) | ||
end | ||
|
||
it "returns an RE2::Regexp instance given a pattern and options" do | ||
re = RE2('w(o)(o)', :case_sensitive => false) | ||
expect(re).to be_a(RE2::Regexp) | ||
expect(re).to_not be_case_sensitive | ||
|
||
expect(re).not_to be_case_sensitive | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.