Class: LrgNumericTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/carat-dev/tc_range.rb

Instance Method Summary collapse

Instance Method Details

#test_includeObject



51
52
53
54
55
56
57
58
# File 'lib/carat-dev/tc_range.rb', line 51

def test_include
  a = Range.new(0,100000000)
  assert_equal(true, a.include?(0))
  assert_equal(true, a.include?(1000))
  assert_equal(true, a.include?(1000000))
  assert_equal(true, a.include?(100000000))
  assert_equal(false, a.include?(INFINITY))
end

#test_include_with_stepObject



59
60
61
62
63
64
65
66
# File 'lib/carat-dev/tc_range.rb', line 59

def test_include_with_step
  a = Range.new(0,100000000)
  assert_equal(true, a.include?(0))
  assert_equal(true, a.include?(5))
  assert_equal(true, a.include?(70007))
  assert_equal(true, a.include?(5000005))
  assert_equal(false, a.include?(INFINITY))
end