mirror of
https://github.com/KLayout/klayout.git
synced 2026-08-29 17:30:09 +02:00
Added some tests for 'switch', small bug fix.
This commit is contained in:
Vendored
+20
-1
@@ -20,6 +20,9 @@ l3.output(3, 0)
|
||||
l1.drc(rectangles).output(100, 0)
|
||||
l1.drc(primary.rectangles).output(101, 0)
|
||||
l2.drc(secondary(l1).rectangles).output(102, 0)
|
||||
l1.drc(squares).output(103, 0)
|
||||
l1.drc(primary.squares).output(104, 0)
|
||||
l2.drc(secondary(l1).squares).output(105, 0)
|
||||
|
||||
l1.drc(rectilinear).output(110, 0)
|
||||
l1.drc(primary.rectilinear).output(111, 0)
|
||||
@@ -37,8 +40,24 @@ l1.drc(! rectilinear).output(140, 0)
|
||||
l1.drc(! rectangles).output(141, 0)
|
||||
|
||||
l1.drc(if_all(! rectangles, area < 8.0)).output(150, 0)
|
||||
l1.drc(if_any(rectangles, area > 8.0)).output(151, 0)
|
||||
l1.drc(if_any(rectangles, area >= 8.0)).output(151, 0)
|
||||
|
||||
l1.drc(if_any(corners.count > 4)).output(160, 0)
|
||||
l1.drc(if_any(corners.count == 4)).output(161, 0)
|
||||
|
||||
l1.drc(switch(! rectangles, primary.sized(100.nm))).output(170, 0)
|
||||
l1.drc(switch(! rectangles, primary.sized(100.nm), primary.sized(200.nm))).output(171, 0)
|
||||
|
||||
error = ""
|
||||
begin
|
||||
l1.drc(switch(! rectangles, primary.sized(100.nm), squares, primary.sized(200.nm).edges))
|
||||
rescue => ex
|
||||
error = ex.to_s
|
||||
end
|
||||
if error != "'drc': All result arguments of 'switch' need to render the same type (got 'Region,Edges')"
|
||||
raise "switch did not give the right error when having different types. Was:\n" + error
|
||||
end
|
||||
|
||||
l1.drc(switch(! rectangles, primary.sized(100.nm), squares, primary.sized(200.nm))).output(172, 0)
|
||||
l1.drc(switch(! rectangles, primary.sized(100.nm), squares, primary.sized(200.nm), primary)).output(173, 0)
|
||||
|
||||
|
||||
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user