Templating bugfix (#86)

This commit is contained in:
Bán Dénes 2023-03-17 10:29:09 +01:00
parent f0d22328cd
commit 9ad080d24c
5 changed files with 34 additions and 7 deletions

View file

@ -1,5 +1,7 @@
points.zones.matrix:
mirror: 10
key:
magic_value: 5
outlines:
edge:
- what: rectangle
@ -44,3 +46,10 @@ pcbs:
params:
start: {x: 5, y: 5}
end: [[6, 6], [7, 7]]
arrobj_templated:
what: arrobj_test
where:
ref: matrix
params:
start: '{x: {{magic_value}}, y: {{magic_value}}}'
end: '[[6, 6], [7, {{magic_value}}]]'

View file

@ -221,6 +221,19 @@
)
(module arrobj_test (layer F.Cu) (tedit 5CF31DEF)
(at 0 0 0)
(fp_line (start 5 5) (end 6 6) (layer Dwgs.User) (width 0.05))
(fp_line (start 5 5) (end 7 5) (layer Dwgs.User) (width 0.05))
)
(gr_line (start -9.5 9.5) (end 9.5 9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
(gr_line (start 9.5 9.5) (end 9.5 -9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
(gr_line (start 9.5 -9.5) (end -9.5 -9.5) (angle 90) (layer Edge.Cuts) (width 0.15))

View file

@ -33,6 +33,7 @@ describe('Utils', function() {
{longlonglong: 'long', short: 'shortshortshort'}
).should.equal('long_shortshortshort')
u.template('{{a.b.c}}', {a: {b: {c: 'deep'}}}).should.equal('deep')
u.template('{x: {{number}}, y: {{number}}}', {number: 5}).should.equal('{x: 5, y: 5}')
})
it('eq', function() {