mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-bin-mruby: skip regexp split bintest when mruby-regexp absent
The bintest added in 9d8d41006b uses `"hello world".split(/\s+/)`,
which raises `uninitialized constant Regexp` in builds that omit
mruby-regexp. Probe whether the mruby binary defines Regexp and
skip the whole assert block when it doesn't; the test is regression
coverage for mruby-regexp's String#split override, so when regexp
isn't loaded there is nothing to verify.
close #6832
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -178,6 +178,10 @@ assert('top level local variables are in file scope') do
|
||||
end
|
||||
|
||||
assert('String#split still works when mruby-regexp is loaded') do
|
||||
# Only meaningful when mruby-regexp is built in; skip otherwise.
|
||||
_, _, stat = Open3.capture3(*(cmd_list("mruby") + ["-e", "Regexp"]))
|
||||
skip "mruby-regexp not loaded" unless stat.success?
|
||||
|
||||
# The regexp-aware override in mruby-regexp/mrblib/string_regexp.rb used to
|
||||
# replace the C-defined String#split, leaving its `return super if ...`
|
||||
# fast paths with no method to delegate to (NoMethodError). Now the
|
||||
|
||||
Reference in New Issue
Block a user