Skip to content

Commit

Permalink
Light refactoring of unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iph0 committed Apr 12, 2024
1 parent e9ab262 commit 1a84abf
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@ func TestErrors(t *testing.T) {
},
)

t.Run("invalid_include_empty",
t.Run("empty_include",
func(t *testing.T) {
_, err := configProc.Load("map:invalid_include_empty")
_, err := configProc.Load("map:empty_include")

if err == nil {
t.Error("no error happened")
Expand Down Expand Up @@ -462,9 +462,9 @@ func TestErrors(t *testing.T) {
},
)

t.Run("invalid_underlay_empty",
t.Run("empty_underlay",
func(t *testing.T) {
_, err := configProc.Load("map:invalid_underlay_empty")
_, err := configProc.Load("map:empty_underlay")

if err == nil {
t.Error("no error happened")
Expand All @@ -474,9 +474,9 @@ func TestErrors(t *testing.T) {
},
)

t.Run("invalid_underlay_ref",
t.Run("invalid_underlay_name",
func(t *testing.T) {
_, err := configProc.Load("map:invalid_underlay_ref")
_, err := configProc.Load("map:invalid_underlay_name")

if err == nil {
t.Error("no error happened")
Expand All @@ -498,9 +498,9 @@ func TestErrors(t *testing.T) {
},
)

t.Run("invalid_overlay_empty",
t.Run("empty_overlay",
func(t *testing.T) {
_, err := configProc.Load("map:invalid_overlay_empty")
_, err := configProc.Load("map:empty_overlay")

if err == nil {
t.Error("no error happened")
Expand All @@ -510,9 +510,9 @@ func TestErrors(t *testing.T) {
},
)

t.Run("invalid_overlay_ref",
t.Run("invalid_overlay_name",
func(t *testing.T) {
_, err := configProc.Load("map:invalid_overlay_ref")
_, err := configProc.Load("map:invalid_overlay_name")

if err == nil {
t.Error("no error happened")
Expand Down Expand Up @@ -719,7 +719,7 @@ func NewProcessor() *conf.Processor {
"paramQ": conf.M{"$include": 42},
},

"invalid_include_empty": conf.M{
"empty_include": conf.M{
"paramQ": conf.M{"$include": []any{}},
},

Expand All @@ -741,23 +741,23 @@ func NewProcessor() *conf.Processor {
"paramQ": conf.M{"$underlay": 42},
},

"invalid_underlay_empty": conf.M{
"empty_underlay": conf.M{
"paramQ": conf.M{"$underlay": []any{}},
},

"invalid_underlay_ref": conf.M{
"invalid_underlay_name": conf.M{
"paramQ": conf.M{"$underlay": []any{42}},
},

"invalid_overlay": conf.M{
"paramQ": conf.M{"$overlay": 42},
},

"invalid_overlay_empty": conf.M{
"empty_overlay": conf.M{
"paramQ": conf.M{"$overlay": []any{}},
},

"invalid_overlay_ref": conf.M{
"invalid_overlay_name": conf.M{
"paramQ": conf.M{"$overlay": []any{42}},
},
},
Expand Down

0 comments on commit 1a84abf

Please sign in to comment.