diff --git a/lib/imgbundler/imgbundler_test.go b/lib/imgbundler/imgbundler_test.go index a8ebe37cd..f70ed5a1c 100644 --- a/lib/imgbundler/imgbundler_test.go +++ b/lib/imgbundler/imgbundler_test.go @@ -17,6 +17,7 @@ import ( "oss.terrastruct.com/d2/lib/log" "oss.terrastruct.com/d2/lib/simplelog" + "oss.terrastruct.com/util-go/go2" ) //go:embed test_png.png @@ -167,7 +168,7 @@ func TestInlineLocal(t *testing.T) { t.Fatal(err) } - sampleSVG := fmt.Sprintf(` + template := ` -`, svgURL, pngURL) +` + sampleSVG := fmt.Sprintf(template, svgURL, pngURL) l := simplelog.FromLibLog(ctx) - out, err := BundleLocal(ctx, l, []byte(sampleSVG), false) + // It doesn't matter what the inputPath is for absolute paths + out, err := BundleLocal(ctx, l, "asdf", []byte(sampleSVG), false) if err != nil { t.Fatal(err) } @@ -208,6 +211,47 @@ width="328" height="587" viewBox="-100 -131 328 587">