Sha256: 8c07d4d8d3d2544c0d0a7249a14653ee6ca0512037f44f8b24025b399582ed16

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

require 'test/unit'
require 'carat/infinity'


class GeneralTest < Test::Unit::TestCase  

  def test_pos
    assert_equal((1.0/0), INFINITY.to_f)
    assert_equal(1, INFINITY<=>5)
    assert_equal(1, INFINITY<=>"a")
    assert_equal("Infinity[0]", INFINITY.to_s)
  end

  def test_neg
    assert_equal((-1.0/0), -INFINITY.to_f)
    assert_equal(-1, -INFINITY<=>5)
    assert_equal(-1, -INFINITY<=>"a")
    assert_equal("-Infinity[0]", (-INFINITY).to_s)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
carats-0.3.0 test/tc_infinity.rb