Exclude forge contracts from runtime dependencies
This commit is contained in:
@@ -10,6 +10,26 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRuntimeFacadeCannotDependOnForge(t *testing.T) {
|
||||
for _, indirect := range []bool{false, true} {
|
||||
name := "direct"
|
||||
dependency := modulePath + "/internal/forge"
|
||||
packages := []listedPackage{{ImportPath: dependency}}
|
||||
if indirect {
|
||||
name = "transitive"
|
||||
packages = append(packages, listedPackage{ImportPath: modulePath + "/internal/runtime", Imports: []string{dependency}})
|
||||
dependency = modulePath + "/internal/runtime"
|
||||
}
|
||||
packages = append(packages, listedPackage{ImportPath: modulePath + "/buildinfo", Imports: []string{dependency}})
|
||||
t.Run(name, func(t *testing.T) {
|
||||
err := checkImportDirections(packages)
|
||||
if err == nil || !strings.Contains(err.Error(), "buildinfo") || !strings.Contains(err.Error(), "/internal/forge") {
|
||||
t.Fatalf("dependency check = %v, want excluded forge runtime dependency", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestExportedContractBoundaries(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
Reference in New Issue
Block a user