Unify analysis product path identity

This commit is contained in:
2026-11-30 04:02:53 +00:00
parent dbfcfa3f75
commit 3795d86587
11 changed files with 135 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
package artifacts
import (
"path/filepath"
"testing"
)
func TestProductRelativePath(t *testing.T) {
root := t.TempDir()
for _, configured := range []string{"artifacts/recap.md", filepath.Join(root, "artifacts", "recap.md")} {
got, err := ProductRelativePath(root, configured)
if err != nil || got != "artifacts/recap.md" {
t.Fatalf("%q: %q, %v", configured, got, err)
}
}
if _, err := ProductRelativePath(root, filepath.Join(t.TempDir(), "recap.md")); err == nil {
t.Fatal("outside absolute path accepted")
}
}