Sha256: 7c7df86d6680ea92fa55121cc7c14414e70c46ec688d628451e8db8f3f84e6d0

Contents?: true

Size: 1010 Bytes

Versions: 2

Compression:

Stored size: 1010 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe NumberCell, "to_biff" do
  before(:all) do
    @w = Workbook.new
    @s = @w.add_sheet('rk_tests')
  end
  
  it "should encode with rk_encode" do
    TEST_VALUES.each_with_index do |x, i|
      # Write original test values
      @s.write(i, 0, x)

      # Write test values divided by 100
      @s.write(i, 3, x/100.00)

      # Write negative of test values
      @s.write(i, 6, x)

      # Write negative test values divided by 100
      @s.write(i, 9, -x/100.00)
    end
  end
  
  after(:all) do
    @w.save("spec/output/cells-rk.xls")
  end
end

TEST_VALUES = [
    130.63999999999999,
    130.64,
    -18.649999999999999,
    -18.65,
    137.19999999999999,
    137.20,
    -16.079999999999998,
    -16.08,
    0,
    1,
    2,
    3,
    0x1fffffff,
    0x20000000,
    0x20000001,
    1000999999,
    0x3fffffff,
    0x40000000,
    0x40000001,
    0x7fffffff,
    0x80000000,
    0x80000001,
    0xffffffff,
    0x100000000,
    0x100000001
]

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
surpass-0.0.6 spec/cell_spec.rb
surpass-0.0.3 spec/cell_spec.rb