Fixed tests for Ruby 2

This commit is contained in:
Matthias Koefferlein 2026-08-15 20:58:44 +02:00
parent 005edf7370
commit ca92d1c042
1 changed files with 4 additions and 1 deletions

View File

@ -3176,7 +3176,10 @@ class Basic_TestClass < TestBase
assert_equal(RBA::A::var2s(RBA::DBox::new(0, 0, 10, 20)), "[dbox:(0,0;10,20)]") assert_equal(RBA::A::var2s(RBA::DBox::new(0, 0, 10, 20)), "[dbox:(0,0;10,20)]")
assert_equal(RBA::A::var2s([ 0.5, "hello" ]), "(##0.5,'hello')") assert_equal(RBA::A::var2s([ 0.5, "hello" ]), "(##0.5,'hello')")
assert_equal(RBA::A::var2s([ 0.5, [ 1, 2 ] ]), "(##0.5,(#1,#2))") assert_equal(RBA::A::var2s([ 0.5, [ 1, 2 ] ]), "(##0.5,(#1,#2))")
assert_equal(RBA::A::var2s({ 1 => 'one', 'two' => 17 }), "{#1=>'one','two'=>#17}") if RUBY_VERSION > "2.0.0"
# Ruby 2 can't pass a hash to a function's argument
assert_equal(RBA::A::var2s({ 1 => 'one', 'two' => 17 }), "{#1=>'one','two'=>#17}")
end
if RBA::A::l_size == 4 if RBA::A::l_size == 4
assert_equal(RBA::A::var2s(100000000000), "#l100000000000") assert_equal(RBA::A::var2s(100000000000), "#l100000000000")
else else