1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
dbu 0.001
target($drc_test_target, "TOP")
def self.expect_count(layer, c, hc, where)
if layer.count != c
raise(where + ": Layer count #{layer.count} does not equal #{c}")
end
if layer.hier_count != hc
raise(where + ": Layer hier count #{layer.hier_count} does not equal #{c}")
end
end
x = polygon_layer
expect_count(x, 0, 0, "empty layer")
x.is_empty? == true || raise("unexpected value")
x.is_box? == false || raise("unexpected value")
x.insert(box(4.0, 0, 4.7, 0.7))
x.is_empty? == false || raise("unexpected value")
x.is_box? == true || raise("unexpected value")
x.insert(polygon([ p(0, 0), p(2.0, 0), p(1.0, 1.0) ]))
x.insert(polygon([ p(0, -5.0), p(2.0, -5.0), p(1.0, -6.0) ]))
x.insert(path([ p(0, -2), p(2.0, -2) ], 0.2))
expect_count(x, 4, 4, "after 3x insert")
x.is_box? == false || raise("unexpected value")
x.output(10, 0)
y = polygon_layer
y.insert(polygon([ p(0, 0), p(0, 1.0), p(2.0, 1.0), p(2.0, 2.0), p(3.0, 2.0), p(3.0, 0) ]))
y.output(11, 0)
|