test/driver/native/test_conversions.rb in octave-ruby-1.0.3 vs test/driver/native/test_conversions.rb in octave-ruby-1.0.4

- old
+ new

@@ -153,29 +153,11 @@ cell_matrix[2,0] = "baz" assert_equal %w(foo bar baz), to_octave_to_ruby(cell_matrix) end - def test_hmm - struct_matrix = Octave::StructMatrix.new(17, 2, "name", "age", "married", "cats", "car") - 17.times do |m| - 2.times do |n| - struct_matrix[m, n]["name"] = "Bob #{m}.#{n}" - struct_matrix[m, n]["age"] = (rand * 100).to_i - struct_matrix[m, n]["married"] = (rand > 0.5) - struct_matrix[m, n]["cats"] = { "name" => "Kitty #{m}.#{n}" } - struct_matrix[m, n]["car"] = nil - end - end - - data = { - "foo" => struct_matrix, - "bar" => [1,2,3,4], - "baz" => struct_matrix - } - - @driver.put_variable "data", data - @driver.feval "save", "-V7", "/tmp/hmm.mat", "data" - # assert_octave_and_ruby_equal data - + 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)" + assert_equal [true, false], boolean_matrix end end