Sha256: 0049420f4ef1f9ee2b1d59b54188c22fadc7553384ad87727c35eb2af55c8d34
Contents?: true
Size: 896 Bytes
Versions: 3
Compression:
Stored size: 896 Bytes
Contents
require_relative "../spec_helper" describe "when MPFI instance is converted to string by some methods." do before(:all) do MPFR.set_default_prec(128) @row = 2 @column = 3 @matrixes = ((0..100).map { |i| MPFI::Matrix.new(GenerateNumber.float_arguments(@column, @row)) }) end it "should return array having strings." do @matrixes.each do |m| m.str_ary_for_inspect.each_with_index do |s, i| s.should eql "#{m[i % @row, i / @row].left.to_strf('%.Re')} #{m[i % @row, i / @row].right.to_strf('%.Re')}" end end end it "should return inspect string." do @matrixes.each do |m| ins = m.inspect ins.should match(/#{Regexp.escape(sprintf("%x", m.object_id))}/) m.each do |a| str = "#{a.left.to_strf('%.Re')} #{a.right.to_strf('%.Re')}" ins.should match(/#{Regexp.escape(str)}/) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ruby-mpfi-0.0.10 | spec/mpfi_matrix/mpfi_matrix_string_spec.rb |
ruby-mpfi-0.0.9 | spec/mpfi_matrix/mpfi_matrix_string_spec.rb |
ruby-mpfi-0.0.8 | spec/mpfi_matrix/mpfi_matrix_string_spec.rb |