Skip to content

Commit febebee

Browse files
committed
Use square brackets in RUBY_DESCRIPTION
`EnvUtil::current_parser` uses a regexp to detect the presence of `+PRISM`, but it is not expecting round brackets in the string. We workaround this by changing round brackets to square brackets. We no longer need to exclude the test `TestPatternMatching::test_alternative_pattern_nested` because it works properly now with PRISM correctly detected.
1 parent 39498b0 commit febebee

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

test/.excludes-mmtk/TestPatternMatching.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/ruby/test_mmtk.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_description
3434
['--disable=mmtk', '--mmtk-max-heap=10240000']
3535
]
3636

37-
MMTK_EXPECETED_PART = '+MMTk(XGC)'
37+
MMTK_EXPECETED_PART = '+MMTk[XGC]'
3838

3939
def test_enable
4040
ENABLE_OPTIONS.each do |version_args|
@@ -107,6 +107,6 @@ def test_gc_stat
107107
end
108108

109109
def scrub_desc(desc)
110-
desc.gsub(/\((MarkSweep|NoGC|Immix|StickyImmix)\)/, '(XGC)')
110+
desc.gsub(/\[(MarkSweep|NoGC|Immix|StickyImmix)\]/, '[XGC]')
111111
end
112112
end

version.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ define_ruby_description(const char *const jit_opt)
227227
+ rb_strlen_lit(" +MN")
228228
#if USE_MMTK
229229
// This should be long enough for all plans we have.
230-
+ rb_strlen_lit(" +MMTk(XXXXXXXXXXXXXXXX)")
230+
+ rb_strlen_lit(" +MMTk[XXXXXXXXXXXXXXXX]")
231231
#endif
232232
+ rb_strlen_lit(" +PRISM")
233233
#if USE_MODULAR_GC
@@ -248,9 +248,9 @@ define_ruby_description(const char *const jit_opt)
248248
if (ruby_mn_threads_enabled) append(" +MN");
249249
if (rb_ruby_prism_p()) append(" +PRISM");
250250
WHEN_USING_MMTK({
251-
append(" +MMTk(");
251+
append(" +MMTk[");
252252
append(mmtk_plan_name());
253-
append(")");
253+
append("]");
254254
})
255255
#if USE_MODULAR_GC
256256
append(GC_DESCRIPTION);

0 commit comments

Comments
 (0)