Sha256: 7f4cbdc688568edaaf1d489e9d2e8ca4fe0e0df3e61ae896185370416bfc7eb4

Contents?: true

Size: 562 Bytes

Versions: 9

Compression:

Stored size: 562 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper'))

class TC_swap < Test::Unit::TestCase
  def setup
    @a=GMP::Z.new(100)
    @b=GMP::Z.new(200)
    @c=GMP::Q.new(100,11)
    @d=GMP::Q.new(200,17)
  end
  
  def test_swap
    @a.swap @b
    @c.swap @d
    assert_equal(@a, 200, "GMP::Z should swap with GMP::Z.")
    assert_equal(@b, 100, "GMP::Z should swap with GMP::Z.")
    assert_equal(@c, GMP::Q.new(200,17), "GMP::Z should swap with GMP::Z.")
    assert_equal(@d, GMP::Q.new(100,11), "GMP::Z should swap with GMP::Z.")
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gmp-0.6.47 test/tc_swap.rb
gmp-0.6.43 test/tc_swap.rb
gmp-0.6.41 test/tc_swap.rb
gmp-0.6.31 test/tc_swap.rb
gmp-0.6.19 test/tc_swap.rb
gmp-0.6.17 test/tc_swap.rb
gmp-0.6.13 test/tc_swap.rb
gmp-0.6.7 test/tc_swap.rb
gmp-0.5.47 test/tc_swap.rb