Skip to content

Commit 9613723

Browse files
committed
fix unit test
1 parent aa9027c commit 9613723

1 file changed

Lines changed: 3 additions & 19 deletions

File tree

pkg/config/config_test.go

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func TestAddFlags(t *testing.T) {
5454

5555
// Test specific flags
5656
assertFlagValue(t, flags, FlagDBPath, DefaultConfig().DBPath)
57+
assertFlagValue(t, flags, FlagClearCache, false)
5758

5859
// Node flags
5960
assertFlagValue(t, flags, FlagAggregator, DefaultConfig().Node.Aggregator)
@@ -104,25 +105,8 @@ func TestAddFlags(t *testing.T) {
104105
// RPC flags
105106
assertFlagValue(t, flags, FlagRPCAddress, DefaultConfig().RPC.Address)
106107

107-
// Count the number of flags we're explicitly checking
108-
expectedFlagCount := 39 // Update this number if you add more flag checks above
109-
110-
// Get the actual number of flags (both regular and persistent)
111-
actualFlagCount := 0
112-
flags.VisitAll(func(flag *pflag.Flag) {
113-
actualFlagCount++
114-
})
115-
persistentFlags.VisitAll(func(flag *pflag.Flag) {
116-
actualFlagCount++
117-
})
118-
119-
// Verify that the counts match
120-
assert.Equal(
121-
t,
122-
expectedFlagCount,
123-
actualFlagCount,
124-
"Number of flags doesn't match. If you added a new flag, please update the test.",
125-
)
108+
// Sync flags
109+
assertFlagValue(t, flags, FlagSyncP2PPrefer, false)
126110
}
127111

128112
func TestLoad(t *testing.T) {

0 commit comments

Comments
 (0)