Sha256: 4d0d829d8e9d93ae693a7da4dec64bbd07f37359ff8a8ef95e49cc5feeae43a3

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/more/infinity.rb
#
# Extracted Fri Sep 08 20:20:32 EDT 2006
# Unit Tools Reap Test Extractor
#

require 'facets/more/infinity.rb'


  require 'test/unit'

  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("PosInf", 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("NegInf", (-INFINITY).to_s)
    end

    def test_ord
      assert_equal((-1.0/0), -INFINITY.to_f)
      assert_equal(-1, 5<=>INFINITY)
      assert_equal(1, 5<=>-INFINITY)
    end

    def test_eq
      assert_equal(Inf, Inf)
      assert_equal(-Inf, -Inf)
      assert_equal(PosInf, PosInf)
      assert_equal(NegInf, NegInf)
      assert_not_equal(NaN, NaN)
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.7.46 test/lib/facets/more/test_infinity.rb