Box dup, object identity etc.
| 428 | |
| 429 | # Box dup, object identity etc. |
| 430 | def test_5_Box |
| 431 | |
| 432 | ref1 = RBA::Box.new( 10, 5, 20, 17 ) |
| 433 | ref2 = RBA::Box.new( 10, 5, 20, 17 ) |
| 434 | ref2.move( RBA::Point.new(-5, 0.0) ) |
| 435 | |
| 436 | box1 = RBA::Box.new( 10, 5, 20, 17 ) |
| 437 | box2 = box1 |
| 438 | box3 = box1.dup |
| 439 | |
| 440 | assert_equal( box1, ref1 ) |
| 441 | assert_equal( box2, ref1 ) |
| 442 | assert_equal( box3, ref1 ) |
| 443 | |
| 444 | box1.p1 = box1.p1 + RBA::Point.new( -5, 0.0 ) |
| 445 | box1.p2 = box1.p2 + RBA::Point.new( -5, 0.0 ) |
| 446 | |
| 447 | assert_equal( box1, ref2 ) |
| 448 | assert_equal( box2, ref2 ) |
| 449 | assert_equal( box3, ref1 ) |
| 450 | |
| 451 | end |
| 452 | |
| 453 | # Box dup, object identity etc. |
| 454 | def test_6_Box |