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

Method test_2

testdata/ruby/dbLayoutDiff.rb:92–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 end
91
92 def test_2
93
94 a = RBA::Layout::new
95 l1a = a.layer(1, 0)
96 c1a = a.create_cell("C1")
97 c1a.shapes(l1a).insert(RBA::Box::new(0, 0, 1000, 1000))
98
99 b = RBA::Layout::new
100 l1b = b.layer(1, 0)
101 l2b = b.layer(2, 0)
102 c1b = b.create_cell("C1")
103 c2b = b.create_cell("C2")
104 c1b.shapes(l1b).insert(RBA::Box::new(1, 0, 1000, 1001))
105 c1b.shapes(l1b).insert(RBA::Edge::new(1, 0, 1000, 1001))
106 c1b.shapes(l1b).insert(RBA::Polygon::new(RBA::Box::new(1, 0, 1000, 1001)))
107 c1b.shapes(l1b).insert(RBA::Path::new([RBA::Point::new(1, 0), RBA::Point::new(1000, 1001)], 0))
108 c1b.shapes(l1b).insert(RBA::Text::new("abc", RBA::Trans::new(1, 0)))
109
110 res = compare(a, b)
111 assert_equal(res, <<"END")
112on_layer_in_b_only 2/0
113on_cell_in_b_only C2
114on_begin_cell C1 C1
115on_begin_layer 1/0:1/0 1/0:0
116on_begin_polygon_differences
117polygon_in_b_only (1,0;1,1001;1000,1001;1000,0)
118on_end_polygon_differences
119on_begin_path_differences
120path_in_b_only (1,0;1000,1001) w=0 bx=0 ex=0 r=false
121on_end_path_differences
122on_begin_text_differences
123text_in_b_only ('abc',r0 1,0)
124on_end_text_differences
125on_begin_box_differences
126box_in_a_only (0,0;1000,1000)
127box_in_b_only (1,0;1000,1001)
128on_end_box_differences
129on_begin_edge_differences
130edge_in_b_only (1,0;1000,1001)
131on_end_edge_differences
132on_end_layer
133on_end_cell
134END
135
136 res = compare(b, a)
137 assert_equal(res, <<"END")
138on_layer_in_a_only 2/0
139on_cell_in_a_only C2
140on_begin_cell C1 C1
141on_begin_layer 1/0:1/0 1/0:0
142on_begin_polygon_differences
143polygon_in_a_only (1,0;1,1001;1000,1001;1000,0)
144on_end_polygon_differences
145on_begin_path_differences
146path_in_a_only (1,0;1000,1001) w=0 bx=0 ex=0 r=false
147on_end_path_differences
148on_begin_text_differences
149text_in_a_only ('abc',r0 1,0)

Callers

nothing calls this directly

Calls 4

compareFunction · 0.70
layerMethod · 0.45
create_cellMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected