d2ir: Add recursive scenario/step test
This commit is contained in:
parent
26a72e3e0c
commit
ece34aaf01
3 changed files with 3200 additions and 7 deletions
|
|
@ -43,8 +43,8 @@ func (c *compiler) compileScenarios(m *Map) {
|
|||
}
|
||||
base := m.Copy(sf).(*Map)
|
||||
sf.Composite = Overlay(base, sf.Map())
|
||||
c.compileScenarios(sf.Map()
|
||||
c.compileSteps(sf.Map()
|
||||
c.compileScenarios(sf.Map())
|
||||
c.compileSteps(sf.Map())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -71,8 +71,8 @@ func (c *compiler) compileSteps(m *Map) {
|
|||
base = steps.Fields[i-1].Map().Copy(sf).(*Map)
|
||||
}
|
||||
sf.Composite = Overlay(base, sf.Map())
|
||||
c.compileScenarios(sf.Map()
|
||||
c.compileSteps(sf.Map()
|
||||
c.compileScenarios(sf.Map())
|
||||
c.compileSteps(sf.Map())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ steps: {
|
|||
}`)
|
||||
assert.Success(t, err)
|
||||
|
||||
assertQuery(t, m, 16, 3, nil, "")
|
||||
assertQuery(t, m, 25, 4, nil, "")
|
||||
|
||||
assertQuery(t, m, 0, 0, nil, "x")
|
||||
assertQuery(t, m, 0, 0, nil, "y")
|
||||
|
|
@ -444,7 +444,7 @@ steps: {
|
|||
assertQuery(t, m, 1, 0, nil, "steps.bingo.p.q")
|
||||
assertQuery(t, m, 0, 0, nil, "steps.bingo.p.q.z")
|
||||
|
||||
assertQuery(t, m, 6, 1, nil, "steps.nuclear")
|
||||
assertQuery(t, m, 15, 2, nil, "steps.nuclear")
|
||||
assertQuery(t, m, 0, 0, nil, "steps.nuclear.x")
|
||||
assertQuery(t, m, 0, 0, nil, "steps.nuclear.y")
|
||||
assertQuery(t, m, 0, 0, nil, `steps.nuclear.(x -> y)[0]`)
|
||||
|
|
@ -453,7 +453,7 @@ steps: {
|
|||
assertQuery(t, m, 0, 0, nil, "steps.nuclear.p.q.z")
|
||||
assertQuery(t, m, 0, 0, nil, "steps.nuclear.quiche")
|
||||
|
||||
assertQuery(t, m, 6, 1, nil, "steps.nuclear.scenarios.bavarian")
|
||||
assertQuery(t, m, 7, 1, nil, "steps.nuclear.scenarios.bavarian")
|
||||
assertQuery(t, m, 0, 0, nil, "steps.nuclear.scenarios.bavarian.x")
|
||||
assertQuery(t, m, 0, 0, nil, "steps.nuclear.scenarios.bavarian.y")
|
||||
assertQuery(t, m, 0, 0, nil, `steps.nuclear.scenarios.bavarian.(x -> y)[0]`)
|
||||
|
|
|
|||
3193
testdata/d2ir/TestCompile/steps/recursive.exp.json
generated
vendored
Normal file
3193
testdata/d2ir/TestCompile/steps/recursive.exp.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue