diff options
Diffstat (limited to 'spec/ruby/language')
-rw-r--r-- | spec/ruby/language/case_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/language/regexp/character_classes_spec.rb | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/spec/ruby/language/case_spec.rb b/spec/ruby/language/case_spec.rb index bf06803764..915c032a71 100644 --- a/spec/ruby/language/case_spec.rb +++ b/spec/ruby/language/case_spec.rb @@ -103,7 +103,7 @@ describe "The 'case'-construct" do $1.should == "42" end - it "tests with a regexp interpolated within another regexp" do + it "tests with a string interpolated in a regexp" do digits = '\d+' case "foo44" when /oo(#{digits})/ @@ -116,7 +116,7 @@ describe "The 'case'-construct" do $1.should == "44" end - it "tests with a string interpolated in a regexp" do + it "tests with a regexp interpolated within another regexp" do digits_regexp = /\d+/ case "foo43" when /oo(#{digits_regexp})/ diff --git a/spec/ruby/language/regexp/character_classes_spec.rb b/spec/ruby/language/regexp/character_classes_spec.rb index 0cf1e9b6f4..12a51178b2 100644 --- a/spec/ruby/language/regexp/character_classes_spec.rb +++ b/spec/ruby/language/regexp/character_classes_spec.rb @@ -609,6 +609,11 @@ describe "Regexp with character classes" do "루비(Ruby)".match(/\p{Hangul}+/u).to_a.should == ["루비"] end + it "supports negated property condition" do + "a".match(/\P{L}/).should be_nil + "1".match(/\P{N}/).should be_nil + end + ruby_bug "#17340", ''...'3.0' do it "raises a RegexpError for an unterminated unicode property" do -> { Regexp.new('\p{') }.should raise_error(RegexpError) |