add test exercising steps/scenarios

This commit is contained in:
Alexander Wang 2023-06-06 22:52:17 -07:00
parent 986f069c18
commit 424f671d54
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
2 changed files with 1202 additions and 0 deletions

View file

@ -84,6 +84,21 @@ label: meow`,
assertQuery(t, m, 0, 0, "root.layers.x.layers.y", "layers.x.y.link")
},
},
{
name: "steps-inheritence",
run: func(t testing.TB) {
m, err := compileFS(t, "index.d2", map[string]string{
"index.d2": `z; steps: { 1: @x; 2: @y }; scenarios: { x: @x; y: @y }`,
"x.d2": `a`,
"y.d2": `b`,
})
assert.Success(t, err)
assertQuery(t, m, 2, 0, nil, "scenarios.x")
assertQuery(t, m, 2, 0, nil, "scenarios.y")
assertQuery(t, m, 2, 0, nil, "steps.1")
assertQuery(t, m, 3, 0, nil, "steps.2")
},
},
{
name: "spread",
run: func(t testing.TB) {

File diff suppressed because it is too large Load diff