Skip to content

Commit

Permalink
Add missing positive spec for Regex#match with option (#12804)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored Nov 30, 2022
1 parent 1b93218 commit 312e369
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/std/regex_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ describe "Regex" do

it "with options" do
/foo/.match(".foo", options: Regex::Options::ANCHORED).should be_nil
/foo/.match("foo", options: Regex::Options::ANCHORED).should_not be_nil
end
end

Expand Down Expand Up @@ -126,6 +127,7 @@ describe "Regex" do

it "with options" do
/foo/.match_at_byte_index("..foo", 1, options: Regex::Options::ANCHORED).should be_nil
/foo/.match_at_byte_index(".foo", 1, options: Regex::Options::ANCHORED).should_not be_nil
end
end

Expand Down Expand Up @@ -195,6 +197,7 @@ describe "Regex" do

it "with options" do
/foo/.matches?(".foo", options: Regex::Options::ANCHORED).should be_false
/foo/.matches?("foo", options: Regex::Options::ANCHORED).should be_true
end

it "matches a large single line string" do
Expand Down Expand Up @@ -229,6 +232,7 @@ describe "Regex" do

it "with options" do
/foo/.matches_at_byte_index?("..foo", 1, options: Regex::Options::ANCHORED).should be_false
/foo/.matches_at_byte_index?(".foo", 1, options: Regex::Options::ANCHORED).should be_true
end
end

Expand Down

0 comments on commit 312e369

Please sign in to comment.