Skip to content

Commit 9103ac1

Browse files
committed
test: refactor codebase to improve performance and reliability
- Add assertion to check that `Redis.Username` is an empty string in the `TestValidateConf` test function Signed-off-by: appleboy <[email protected]>
1 parent f2fc77d commit 9103ac1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ stat:
109109
redis:
110110
cluster: false
111111
addr: "localhost:6379" # if cluster is true, you may set this to "localhost:6379,localhost:6380,localhost:6381"
112-
username: ""
112+
username: ""
113113
password: ""
114114
db: 0
115115
boltdb:

config/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ func (suite *ConfigTestSuite) TestValidateConf() {
208208
assert.Equal(suite.T(), "memory", suite.ConfGorush.Stat.Engine)
209209
assert.Equal(suite.T(), false, suite.ConfGorush.Stat.Redis.Cluster)
210210
assert.Equal(suite.T(), "localhost:6379", suite.ConfGorush.Stat.Redis.Addr)
211+
assert.Equal(suite.T(), "", suite.ConfGorush.Stat.Redis.Username)
211212
assert.Equal(suite.T(), "", suite.ConfGorush.Stat.Redis.Password)
212213
assert.Equal(suite.T(), 0, suite.ConfGorush.Stat.Redis.DB)
213214

0 commit comments

Comments
 (0)