summaryrefslogtreecommitdiff
path: root/internal/config/config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config_test.go')
-rw-r--r--internal/config/config_test.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index a8535be..630fa47 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -152,6 +152,43 @@ func TestConfig_showIOAvgLineRoundTrip(t *testing.T) {
}
}
+func TestConfig_showSeparatorsRoundTrip(t *testing.T) {
+ // Write a config with showseparators=1, read it back, verify round-trip
+ c := Default()
+ c.ShowSeparators = true
+
+ dir := t.TempDir()
+ path := filepath.Join(dir, "rc")
+ f, err := os.Create(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := c.writeTo(f); err != nil {
+ f.Close()
+ t.Fatal(err)
+ }
+ f.Close()
+
+ data, _ := os.ReadFile(path)
+ if !bytes.Contains(data, []byte("showseparators=1")) {
+ t.Errorf("expected showseparators=1 in output, got:\n%s", data)
+ }
+
+ // Read it back
+ c2 := Default()
+ f2, err := os.Open(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer f2.Close()
+ if err := c2.parseReader(f2); err != nil {
+ t.Fatal(err)
+ }
+ if !c2.ShowSeparators {
+ t.Error("expected ShowSeparators=true after round-trip")
+ }
+}
+
func TestGetClusterHostsFromFile(t *testing.T) {
dir := t.TempDir()
path := filepath.Join(dir, "clusters")