Update bootstraptest test for colon-style hash inspect

This commit is contained in:
tompng 2024-06-08 01:20:03 +09:00 committed by Yusuke Endoh
parent a8a0591253
commit f4e548924e
Notes: git 2024-10-03 09:47:29 +00:00
3 changed files with 14 additions and 14 deletions

View File

@ -571,7 +571,7 @@ assert_equal '[RuntimeError, "ok", true]', %q{
} }
# threads in a ractor will killed # threads in a ractor will killed
assert_equal '{:ok=>3}', %q{ assert_equal '{ok: 3}', %q{
Ractor.new Ractor.current do |main| Ractor.new Ractor.current do |main|
q = Thread::Queue.new q = Thread::Queue.new
Thread.new do Thread.new do

View File

@ -1798,7 +1798,7 @@ assert_equal '{}', %q{
} }
# test building hash with values # test building hash with values
assert_equal '{:foo=>:bar}', %q{ assert_equal '{foo: :bar}', %q{
def build_hash(val) def build_hash(val)
{ foo: val } { foo: val }
end end
@ -3375,7 +3375,7 @@ assert_equal '[[1, 2, 3, 4]]', %q{
} }
# cfunc kwargs # cfunc kwargs
assert_equal '{:foo=>123}', %q{ assert_equal '{foo: 123}', %q{
def foo(bar) def foo(bar)
bar.store(:value, foo: 123) bar.store(:value, foo: 123)
bar[:value] bar[:value]
@ -3386,7 +3386,7 @@ assert_equal '{:foo=>123}', %q{
} }
# cfunc kwargs # cfunc kwargs
assert_equal '{:foo=>123}', %q{ assert_equal '{foo: 123}', %q{
def foo(bar) def foo(bar)
bar.replace(foo: 123) bar.replace(foo: 123)
end end
@ -3396,7 +3396,7 @@ assert_equal '{:foo=>123}', %q{
} }
# cfunc kwargs # cfunc kwargs
assert_equal '{:foo=>123, :bar=>456}', %q{ assert_equal '{foo: 123, bar: 456}', %q{
def foo(bar) def foo(bar)
bar.replace(foo: 123, bar: 456) bar.replace(foo: 123, bar: 456)
end end
@ -3406,7 +3406,7 @@ assert_equal '{:foo=>123, :bar=>456}', %q{
} }
# variadic cfunc kwargs # variadic cfunc kwargs
assert_equal '{:foo=>123}', %q{ assert_equal '{foo: 123}', %q{
def foo(bar) def foo(bar)
bar.merge(foo: 123) bar.merge(foo: 123)
end end
@ -3530,7 +3530,7 @@ assert_equal "true", %q{
} }
# duphash # duphash
assert_equal '{:foo=>123}', %q{ assert_equal '{foo: 123}', %q{
def foo def foo
{foo: 123} {foo: 123}
end end
@ -3540,7 +3540,7 @@ assert_equal '{:foo=>123}', %q{
} }
# newhash # newhash
assert_equal '{:foo=>2}', %q{ assert_equal '{foo: 2}', %q{
def foo def foo
{foo: 1+1} {foo: 1+1}
end end
@ -4349,7 +4349,7 @@ assert_equal "ArgumentError", %q{
# Rest with block # Rest with block
# Simplified code from railsbench # Simplified code from railsbench
assert_equal '[{"/a"=>"b", :as=>:c, :via=>:post}, [], nil]', %q{ assert_equal '[{"/a" => "b", as: :c, via: :post}, [], nil]', %q{
def match(path, *rest, &block) def match(path, *rest, &block)
[path, rest, block] [path, rest, block]
end end
@ -4610,7 +4610,7 @@ assert_equal '[nil, "yield"]', %q{
} }
# splat with ruby2_keywords into rest parameter # splat with ruby2_keywords into rest parameter
assert_equal '[[{:a=>1}], {}]', %q{ assert_equal '[[{a: 1}], {}]', %q{
ruby2_keywords def foo(*args) = args ruby2_keywords def foo(*args) = args
def bar(*args, **kw) = [args, kw] def bar(*args, **kw) = [args, kw]
@ -4651,7 +4651,7 @@ assert_normal_exit %q{
} }
# a kwrest case # a kwrest case
assert_equal '[1, 2, {:complete=>false}]', %q{ assert_equal '[1, 2, {complete: false}]', %q{
def rest(foo: 1, bar: 2, **kwrest) def rest(foo: 1, bar: 2, **kwrest)
[foo, bar, kwrest] [foo, bar, kwrest]
end end