Skip to content

Commit

Permalink
Clarify spec
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Oct 18, 2023
1 parent e80982a commit 264328e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/ruby/core/regexp/union_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 264328e

Please sign in to comment.