@@ -14,6 +14,7 @@ import (
1414 "github.com/tkrop/go-config/config"
1515 "github.com/tkrop/go-config/internal/filepath"
1616 "github.com/tkrop/go-testing/mock"
17+ ref "github.com/tkrop/go-testing/reflect"
1718 "github.com/tkrop/go-testing/test"
1819)
1920
@@ -66,7 +67,7 @@ var configTestCases = map[string]ConfigParams{
6667 r .SetDefault ("viper.panic.load" , true )
6768 },
6869 expect : test .Panic (config .NewErrConfig ("loading file" , "test" ,
69- test .NewBuilder [viper.ConfigFileNotFoundError ]().
70+ ref .NewBuilder [viper.ConfigFileNotFoundError ]().
7071 Set ("locations" , fmt .Sprintf ("%s" , configPaths )).
7172 Set ("name" , "test" ).Build ())),
7273 },
@@ -92,7 +93,7 @@ var configTestCases = map[string]ConfigParams{
9293 },
9394 expect : test .Panic (config .NewErrConfig ("unmarshal config" ,
9495 "test" , fmt .Errorf ("decoding failed due to the following error(s):\n \n %w" ,
95- errors .Join (test .NewBuilder [* mapstructure.DecodeError ]().
96+ errors .Join (ref .NewBuilder [* mapstructure.DecodeError ]().
9697 Set ("name" , "Info.Dirty" ).
9798 Set ("err" , & mapstructure.ParseError {
9899 Expected : reflect .ValueOf (true ), Value : "5s" ,
@@ -103,7 +104,8 @@ var configTestCases = map[string]ConfigParams{
103104
104105func TestConfig (t * testing.T ) {
105106 test .Map (t , configTestCases ).
106- Filter ("panic-after-unmarshal-failure-next" , false ).
107+ Filter (test .Not (test.Pattern [ConfigParams ](
108+ "panic-after-unmarshal-failure-next" ))).
107109 RunSeq (func (t test.Test , param ConfigParams ) {
108110 // Given
109111 mock .NewMocks (t ).Expect (param .expect )
0 commit comments