fix tests
This commit is contained in:
parent
7a4ea253a9
commit
1ecadc576c
8 changed files with 10 additions and 7 deletions
|
|
@ -1080,6 +1080,13 @@ func (kp *KeyPath) IDA() (ida []String) {
|
|||
return ida
|
||||
}
|
||||
|
||||
func (kp *KeyPath) StringIDA() (ida []string) {
|
||||
for _, el := range kp.Path {
|
||||
ida = append(ida, el.Unbox().ScalarString())
|
||||
}
|
||||
return ida
|
||||
}
|
||||
|
||||
func (kp *KeyPath) Copy() *KeyPath {
|
||||
kp2 := *kp
|
||||
kp2.Path = nil
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ func Run(ctx context.Context, ms *xmain.State) (err error) {
|
|||
if err != nil {
|
||||
return xmain.UsageErrorf("invalid target: %s", *targetFlag)
|
||||
}
|
||||
boardPath = key.IDA()
|
||||
boardPath = key.StringIDA()
|
||||
}
|
||||
|
||||
ctx, cancel := timelib.WithTimeout(ctx, time.Minute*2)
|
||||
|
|
|
|||
|
|
@ -1230,11 +1230,7 @@ func (c *compiler) validateBoardLinks(g *d2graph.Graph) {
|
|||
continue
|
||||
}
|
||||
|
||||
formattedIDA := []string{}
|
||||
for _, id := range linkKey.IDA() {
|
||||
formattedIDA = append(formattedIDA, id.ScalarString())
|
||||
}
|
||||
if slices.Equal(formattedIDA, obj.Graph.IDA()) {
|
||||
if slices.Equal(linkKey.StringIDA(), obj.Graph.IDA()) {
|
||||
obj.Link = nil
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ func GetRefRanges(path string, fs map[string]string, boardPath []string, key str
|
|||
var f *d2ir.Field
|
||||
if mk.Key != nil {
|
||||
for _, p := range mk.Key.Path {
|
||||
f = m.GetField(p.Unbox().ScalarString())
|
||||
f = m.GetField(p.Unbox())
|
||||
if f == nil {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
BIN
e2etests-cli/testdata/TestCLI_E2E/no-nav-pdf.exp.pdf
vendored
BIN
e2etests-cli/testdata/TestCLI_E2E/no-nav-pdf.exp.pdf
vendored
Binary file not shown.
Binary file not shown.
BIN
e2etests-cli/testdata/TestCLI_E2E/theme-pdf.exp.pdf
vendored
BIN
e2etests-cli/testdata/TestCLI_E2E/theme-pdf.exp.pdf
vendored
Binary file not shown.
Loading…
Reference in a new issue