refactor(config): restructured with better concurrency and error handling, reduced cross referencing

This commit is contained in:
yusing
2025-10-09 01:02:24 +08:00
parent d08be872a0
commit cab68807ee
25 changed files with 720 additions and 623 deletions

View File

@@ -29,16 +29,15 @@ func run(t *testing.T, match []string, noMatch []string) {
for _, test := range match {
t.Run(test, func(t *testing.T) {
found, err := ep.findRouteFunc(test)
expect.NoError(t, err)
found := ep.findRouteFunc(test)
expect.NotNil(t, found)
})
}
for _, test := range noMatch {
t.Run(test, func(t *testing.T) {
_, err := ep.findRouteFunc(test)
expect.ErrorIs(t, ErrNoSuchRoute, err)
found := ep.findRouteFunc(test)
expect.Nil(t, found)
})
}
}