Skip to content

Commit 4043a19

Browse files
[ADD] Read() call and error checks in OnChange tests
1 parent 820c684 commit 4043a19

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

config/core_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@ func TestOnChangeCallbacks(t *testing.T) {
634634
t.Errorf("Write() failed: %v", err)
635635
}
636636

637+
err = config.Read()
638+
if err != nil {
639+
t.Errorf("Read() failed: %v", err)
640+
}
641+
637642
if !callbackCalled {
638643
t.Error("OnChange callback should have been called")
639644
}
@@ -666,8 +671,13 @@ func TestOnChangeCallbackError(t *testing.T) {
666671
}
667672

668673
err = config.Write(newCfg)
674+
if err != nil {
675+
t.Errorf("Write() failed: %v", err)
676+
}
677+
678+
err = config.Read()
669679
if err == nil {
670-
t.Error("Write() should fail when callback returns error")
680+
t.Error("Read() should fail when callback returns error")
671681
}
672682
}
673683

0 commit comments

Comments
 (0)