From 264328ee66236db1ca8c16ed1820a6a3704d625d Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 18 Oct 2023 12:29:10 +0200 Subject: [PATCH] Clarify spec --- spec/ruby/core/regexp/union_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/ruby/core/regexp/union_spec.rb b/spec/ruby/core/regexp/union_spec.rb index ddbe869f810f..ea5a5053f725 100644 --- a/spec/ruby/core/regexp/union_spec.rb +++ b/spec/ruby/core/regexp/union_spec.rb @@ -45,6 +45,9 @@ it "returns ASCII-8BIT if the regexp encodings are ASCII-8BIT and at least one has non-ASCII characters" do us_ascii_implicit, us_ascii_explicit, binary = /abc/, /[\x00-\x7f]/n, /[\x80-\xBF]/n + us_ascii_implicit.encoding.should == Encoding::US_ASCII + us_ascii_explicit.encoding.should == Encoding::US_ASCII + binary.encoding.should == Encoding::BINARY Regexp.union(us_ascii_implicit, us_ascii_explicit, binary).encoding.should == Encoding::BINARY Regexp.union(us_ascii_implicit, binary, us_ascii_explicit).encoding.should == Encoding::BINARY