Skip to content

Commit

Permalink
Added test for Point/DPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koefferlein committed Nov 17, 2024
1 parent 476ec3a commit 0ce7fb1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions testdata/ruby/dbPointTest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,28 @@ def test_4_Point

end

# move/moved
def test_5_Point

p1 = RBA::DPoint::new(1, 2)
assert_equal(p1.moved(2, 3).to_s, "3,5")
assert_equal(p1.to_s, "1,2")
assert_equal(p1.move(2, 3).to_s, "3,5")
assert_equal(p1.to_s, "3,5")

p1 = RBA::DPoint::new(1, 2)
assert_equal(p1.moved(RBA::DVector::new(2, 3)).to_s, "3,5")
assert_equal(p1.to_s, "1,2")
assert_equal(p1.move(RBA::DVector::new(2, 3)).to_s, "3,5")
assert_equal(p1.to_s, "3,5")

p1 = RBA::DPoint::new(1, 2)
assert_equal(p1.moved(:dx => 1).to_s, "2,2")
p1.move(:dy => 3)
assert_equal(p1.to_s, "1,5")

end

end

load("test_epilogue.rb")

0 comments on commit 0ce7fb1

Please sign in to comment.