diff --git a/test/protocol/eval_test.rb b/test/protocol/eval_test.rb index ee56a63e8..443df11b1 100644 --- a/test/protocol/eval_test.rb +++ b/test/protocol/eval_test.rb @@ -13,13 +13,14 @@ class EvalTest < ProtocolTestCase 6| f = 6 RUBY - def test_eval_evaluates_arithmetic_expressions + def test_eval_evaluates_expressions run_protocol_scenario PROGRAM do req_add_breakpoint 5 req_continue assert_repl_result({value: '2', type: 'Integer'}, 'a') assert_repl_result({value: '4', type: 'Integer'}, 'd') assert_repl_result({value: '3', type: 'Integer'}, '1+2') + assert_repl_result({value: 'false', type: 'FalseClass'}, 'a == 1') req_terminate_debuggee end end diff --git a/test/support/protocol_test_case.rb b/test/support/protocol_test_case.rb index 888b06f51..4be42739d 100644 --- a/test/support/protocol_test_case.rb +++ b/test/support/protocol_test_case.rb @@ -455,10 +455,10 @@ def close_reader HOST = '127.0.0.1' JAVASCRIPT_TYPE_TO_CLASS_MAPS = { - 'string' => String, - 'number' => Integer, - 'boolean' => [TrueClass, FalseClass], - 'symbol' => Symbol + 'string' => "String", + 'number' => "Integer", + 'boolean' => ["TrueClass", "FalseClass"], + 'symbol' => "Symbol" } def assert_eval_result context, expression, expected, frame_idx @@ -497,7 +497,7 @@ def assert_eval_result context, expression, expected, frame_idx failure_msg = FailureMessage.new{create_protocol_message "result:\n#{JSON.pretty_generate res}"} - cl = res.dig(:result, :result, :className) || JAVASCRIPT_TYPE_TO_CLASS_MAPS[res.dig(:result, :result, :type)].inspect + cl = res.dig(:result, :result, :className) || JAVASCRIPT_TYPE_TO_CLASS_MAPS[res.dig(:result, :result, :type)] result_type = Array cl assert_include result_type, expected[:type], failure_msg