[#106355] [Ruby master Bug#18373] RBS build failure: '/include/x86_64-linux/ruby/config.h', needed by 'constants.o'. — "vo.x (Vit Ondruch)" <noreply@...>
Issue #18373 has been reported by vo.x (Vit Ondruch).
28 messages
2021/12/01
[ruby-core:106888] [Ruby master Bug#18449] Bug in 3.1 regexp literals with \c
From:
"zenspider (Ryan Davis)" <noreply@...>
Date:
2021-12-29 04:36:13 UTC
List:
ruby-core #106888
Issue #18449 has been reported by zenspider (Ryan Davis).
----------------------------------------
Bug #18449: Bug in 3.1 regexp literals with \c
https://bugs.ruby-lang.org/issues/18449
* Author: zenspider (Ryan Davis)
* Status: Open
* Priority: Normal
* Target version: 3.1
* ruby -v: 3.1.0
----------------------------------------
This file passes on 2.7, 3.0, and fails (if you remove the `skip` line) on 3.1:
``` ruby
#!/usr/bin/env ruby -w
require "minitest/autorun"
class TestRegexpCreation < Minitest::Test
R31 = RUBY_VERSION > "3.1"
def test_literal_equivalence
if R31 then
assert_equal(/\x03/, /\cC/) # wrong! (note the assert)
else
refute_equal(/\x03/, /\cC/)
end
end
def test_from_literal
re = /\cC/
assert_equal(/\cC/, re)
if R31 then
assert_equal "\\x03", re.source # wrong?
else
assert_equal "\\cC", re.source
end
end
def test_from_source
re = Regexp.new "\\cC"
assert_equal "\\cC", re.source
if R31 then # wrong!
skip
assert_equal(/\cC/, re) # can't be written to pass
assert_equal(/\x03/, re) # can't be written to pass
else
assert_equal(/\cC/, re)
end
end
end
# on 3.1:
#
# if written as:
#
# assert_equal(/\x03/, re)
#
# it fails with:
#
# 1) Failure:
# TestRegexpCreation#test_source [regexp31.rb:32]:
# Expected: /\x03/
# Actual: /\cC/
#
# but if written as:
#
# assert_equal(/\cC/, re)
#
# it ALSO fails with:
#
# 1) Failure:
# TestRegexpCreation#test_source [regexp31.rb:32]:
# Expected: /\x03/
# Actual: /\cC/
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>