Sha256: 5d5253b211fe6e7bfc8cd4dade31070286ecfe5365e3655d6edb816724907d88

Contents?: true

Size: 467 Bytes

Versions: 3

Compression:

Stored size: 467 Bytes

Contents

require 'test/unit'
require 'facet/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

3 entries across 3 versions & 1 rubygems

Version Path
facets-0.7.0 test/tc_infinity.rb
facets-0.7.1 test/tc_infinity.rb
facets-0.7.2 test/tc_infinity.rb