summaryrefslogtreecommitdiff
path: root/spec/ruby/language/regexp/character_classes_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/language/regexp/character_classes_spec.rb')
-rw-r--r--spec/ruby/language/regexp/character_classes_spec.rb30
1 files changed, 14 insertions, 16 deletions
diff --git a/spec/ruby/language/regexp/character_classes_spec.rb b/spec/ruby/language/regexp/character_classes_spec.rb
index a466f745ae..c0f69bea9b 100644
--- a/spec/ruby/language/regexp/character_classes_spec.rb
+++ b/spec/ruby/language/regexp/character_classes_spec.rb
@@ -609,25 +609,23 @@ describe "Regexp with character classes" do
"루비(Ruby)".match(/\p{Hangul}+/u).to_a.should == ["루비"]
end
- ruby_version_is "2.4" do
- it "supports \\X (unicode 9.0 with UTR #51 workarounds)" do
- # simple emoji without any fancy modifier or ZWJ
- /\X/.match("\u{1F98A}").to_a.should == ["🦊"]
+ it "supports \\X (unicode 9.0 with UTR #51 workarounds)" do
+ # simple emoji without any fancy modifier or ZWJ
+ /\X/.match("\u{1F98A}").to_a.should == ["🦊"]
- # skin tone modifier
- /\X/.match("\u{1F918}\u{1F3FD}").to_a.should == ["🀘🏽"]
+ # skin tone modifier
+ /\X/.match("\u{1F918}\u{1F3FD}").to_a.should == ["🀘🏽"]
- # emoji joined with ZWJ
- /\X/.match("\u{1F3F3}\u{FE0F}\u{200D}\u{1F308}").to_a.should == ["πŸ³οΈβ€πŸŒˆ"]
- /\X/.match("\u{1F469}\u{200D}\u{1F469}\u{200D}\u{1F467}\u{200D}\u{1F466}").to_a.should == ["πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦"]
+ # emoji joined with ZWJ
+ /\X/.match("\u{1F3F3}\u{FE0F}\u{200D}\u{1F308}").to_a.should == ["πŸ³οΈβ€πŸŒˆ"]
+ /\X/.match("\u{1F469}\u{200D}\u{1F469}\u{200D}\u{1F467}\u{200D}\u{1F466}").to_a.should == ["πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦"]
- # without the ZWJ
- /\X+/.match("\u{1F3F3}\u{FE0F}\u{1F308}").to_a.should == ["🏳️🌈"]
- /\X+/.match("\u{1F469}\u{1F469}\u{1F467}\u{1F466}").to_a.should == ["πŸ‘©πŸ‘©πŸ‘§πŸ‘¦"]
+ # without the ZWJ
+ /\X+/.match("\u{1F3F3}\u{FE0F}\u{1F308}").to_a.should == ["🏳️🌈"]
+ /\X+/.match("\u{1F469}\u{1F469}\u{1F467}\u{1F466}").to_a.should == ["πŸ‘©πŸ‘©πŸ‘§πŸ‘¦"]
- # both of the ZWJ combined
- /\X+/.match("\u{1F3F3}\u{FE0F}\u{200D}\u{1F308}\u{1F469}\u{200D}\u{1F469}\u{200D}\u{1F467}\u{200D}\u{1F466}")
- .to_a.should == ["πŸ³οΈβ€πŸŒˆπŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦"]
- end
+ # both of the ZWJ combined
+ /\X+/.match("\u{1F3F3}\u{FE0F}\u{200D}\u{1F308}\u{1F469}\u{200D}\u{1F469}\u{200D}\u{1F467}\u{200D}\u{1F466}")
+ .to_a.should == ["πŸ³οΈβ€πŸŒˆπŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦"]
end
end