update validation and test
This commit is contained in:
parent
a03d9bd24e
commit
b41a9e4e96
5 changed files with 10956 additions and 206 deletions
|
|
@ -1083,6 +1083,14 @@ func (c *compiler) validateNear(g *d2graph.Graph) {
|
||||||
if (isSrcNearConst || isDstNearConst) && srcNearContainer != dstNearContainer {
|
if (isSrcNearConst || isDstNearConst) && srcNearContainer != dstNearContainer {
|
||||||
// c.errorf(edge.References[0].Edge, "cannot connect objects from within a container, that has near constant set, to objects outside that container")
|
// c.errorf(edge.References[0].Edge, "cannot connect objects from within a container, that has near constant set, to objects outside that container")
|
||||||
}
|
}
|
||||||
|
if edge.Src.IsConstantNear() && edge.Dst.IsDescendantOf(edge.Src) {
|
||||||
|
c.errorf(edge.GetAstEdge(), "edge from constant near %#v cannot enter itself", edge.Src.AbsID())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if edge.Dst.IsConstantNear() && edge.Src.IsDescendantOf(edge.Dst) {
|
||||||
|
c.errorf(edge.GetAstEdge(), "edge from constant near %#v cannot enter itself", edge.Dst.AbsID())
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1226,7 +1226,7 @@ func (obj *Object) Connect(srcID, dstID []string, srcArrow, dstArrow bool, label
|
||||||
dst := obj.ensureChildEdge(dstID)
|
dst := obj.ensureChildEdge(dstID)
|
||||||
|
|
||||||
if src.OuterSequenceDiagram() != dst.OuterSequenceDiagram() {
|
if src.OuterSequenceDiagram() != dst.OuterSequenceDiagram() {
|
||||||
return nil, errors.New("connections within sequence diagrams can connect only to other objects within the same sequence diagram")
|
// return nil, errors.New("connections within sequence diagrams can connect only to other objects within the same sequence diagram")
|
||||||
}
|
}
|
||||||
|
|
||||||
e := &Edge{
|
e := &Edge{
|
||||||
|
|
|
||||||
6
e2etests/testdata/files/nesting_power.d2
vendored
6
e2etests/testdata/files/nesting_power.d2
vendored
|
|
@ -24,7 +24,7 @@ l: Left Constant Near {
|
||||||
grid: {
|
grid: {
|
||||||
shape: sequence_diagram
|
shape: sequence_diagram
|
||||||
|
|
||||||
with -> a -> sequence diagram -> you can
|
with -> a -> sequence diagram.x -> you can
|
||||||
|
|
||||||
you can: {
|
you can: {
|
||||||
grid-rows: 2
|
grid-rows: 2
|
||||||
|
|
@ -45,6 +45,7 @@ l: Left Constant Near {
|
||||||
continue -> nesting
|
continue -> nesting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
you can.here and.nesting -> sequence diagram.x: {class: green}
|
||||||
}
|
}
|
||||||
this.row 2 -> is.child of is.grandchild: {class: green}
|
this.row 2 -> is.child of is.grandchild: {class: green}
|
||||||
# this.row 2 -> grid.you can
|
# this.row 2 -> grid.you can
|
||||||
|
|
@ -246,6 +247,9 @@ more: {
|
||||||
more.container.a_sequence -> directions.v.d.4: {class: green}
|
more.container.a_sequence -> directions.v.d.4: {class: green}
|
||||||
directions.l.2 -> center.step: {class: green}
|
directions.l.2 -> center.step: {class: green}
|
||||||
center.step -> more.stylish.x: {class: green}
|
center.step -> more.stylish.x: {class: green}
|
||||||
|
directions.l.1 -> seq.item.a.b: to inside sequence diagram {class: green}
|
||||||
|
directions.l.1 -> seq.itemResponse.a: to inside sequence diagram {class: green}
|
||||||
|
directions.v.d.2 -> seq.scorer.abc: to inside sequence diagram {class: green}
|
||||||
|
|
||||||
center.cloud -> more.stylish: {class: green}
|
center.cloud -> more.stylish: {class: green}
|
||||||
more.container.a_shape -> r.is: to constant near {class: green}
|
more.container.a_shape -> r.is: to constant near {class: green}
|
||||||
|
|
|
||||||
10822
e2etests/testdata/stable/nesting_power/dagre/board.exp.json
generated
vendored
10822
e2etests/testdata/stable/nesting_power/dagre/board.exp.json
generated
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 116 KiB |
Loading…
Reference in a new issue