test/driver/native/test_conversions.rb in octave-ruby-1.0.9 vs test/driver/native/test_conversions.rb in octave-ruby-2.0.0
- old
+ new
@@ -7,15 +7,15 @@
require 'yaml'
class ConversionsTest < Test::Unit::TestCase
def setup
@driver = Octave::Driver::Native::Driver.new
- @driver.feval "eval", "function r = to_octave(val); r = val; endfunction"
end
def to_octave_to_ruby(value)
- @driver.feval "to_octave", value
+ @driver.put_variable("to_octave_to_ruby_variable", value)
+ @driver.get_variable("to_octave_to_ruby_variable")
end
def assert_octave_and_ruby_equal(value)
result = to_octave_to_ruby(value)
assert_equal value, result
@@ -195,9 +195,10 @@
assert_equal %w(foo bar baz), to_octave_to_ruby(cell_matrix)
end
def test_should_convert_boolean_matrix
assert_octave_and_ruby_equal [true, false, true]
- boolean_matrix = @driver.feval "eval", "x = [1,2]; (x > 2 | x < 2)"
+ @driver.put_variable("x", [1,2])
+ boolean_matrix = @driver.feval "eval", "(x > 2 | x < 2)"
assert_equal [true, false], boolean_matrix
end
end