[ci-force] fix last
This commit is contained in:
parent
39682629f9
commit
fe8efdf09e
2 changed files with 9 additions and 1 deletions
|
|
@ -3,6 +3,8 @@ package d2oracle
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"oss.terrastruct.com/d2/d2ast"
|
||||||
|
"oss.terrastruct.com/d2/d2format"
|
||||||
"oss.terrastruct.com/d2/d2graph"
|
"oss.terrastruct.com/d2/d2graph"
|
||||||
"oss.terrastruct.com/d2/d2parser"
|
"oss.terrastruct.com/d2/d2parser"
|
||||||
)
|
)
|
||||||
|
|
@ -97,5 +99,5 @@ func GetID(key string) string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return mk.Key.Path[len(mk.Key.Path)-1].Unbox().ScalarString()
|
return d2format.Format(d2ast.RawString(mk.Key.Path[len(mk.Key.Path)-1].Unbox().ScalarString(), true))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,3 +18,9 @@ func TestIsLabelKeyID(t *testing.T) {
|
||||||
assert.Equal(t, false, d2oracle.IsLabelKeyID("x", "y"))
|
assert.Equal(t, false, d2oracle.IsLabelKeyID("x", "y"))
|
||||||
assert.Equal(t, false, d2oracle.IsLabelKeyID("x->y", "y"))
|
assert.Equal(t, false, d2oracle.IsLabelKeyID("x->y", "y"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetID(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
assert.Equal(t, `"y (z)"`, d2oracle.GetID(`y (z)`))
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue