ax(node): rename tt to testCase in TestWorker_ConvertMinerStats_Good
AX Principle 1 — predictable names over short names. `tt` is an abbreviated loop variable; `testCase` states the semantic clearly. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
7b098da3be
commit
b210b160d9
1 changed files with 5 additions and 5 deletions
|
|
@ -893,16 +893,16 @@ func TestWorker_ConvertMinerStats_Good(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
for _, testCase := range tests {
|
||||
t.Run(testCase.name, func(t *testing.T) {
|
||||
mock := &mockMinerInstance{name: "test", minerType: "xmrig"}
|
||||
result := convertMinerStats(mock, tt.rawStats)
|
||||
result := convertMinerStats(mock, testCase.rawStats)
|
||||
|
||||
if result.Name != "test" {
|
||||
t.Errorf("expected name 'test', got '%s'", result.Name)
|
||||
}
|
||||
if result.Hashrate != tt.wantHash {
|
||||
t.Errorf("expected hashrate %f, got %f", tt.wantHash, result.Hashrate)
|
||||
if result.Hashrate != testCase.wantHash {
|
||||
t.Errorf("expected hashrate %f, got %f", testCase.wantHash, result.Hashrate)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue