MCPcopy Create free account
hub / github.com/KLayout/klayout / test_5_Box

Method test_5_Box

testdata/ruby/dbBoxTest.rb:430–451  ·  view source on GitHub ↗

Box dup, object identity etc.

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

moveMethod · 0.45
dupMethod · 0.45
p1Method · 0.45
p2Method · 0.45

Tested by

no test coverage detected