mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 06:54:41 +00:00
test: use 'f' functions with formatting directives
This commit is contained in:
@@ -35,7 +35,7 @@ func TestEvidence_Misbehavior(t *testing.T) {
|
||||
|
||||
// Check that evidence was as expected
|
||||
misbehavior, ok := node.Misbehaviors[nodeEvidence.Height()]
|
||||
require.True(t, ok, "found unexpected evidence %v in height %v",
|
||||
require.Truef(t, ok, "found unexpected evidence %v in height %v",
|
||||
nodeEvidence, block.Height)
|
||||
|
||||
switch misbehavior {
|
||||
@@ -50,7 +50,7 @@ func TestEvidence_Misbehavior(t *testing.T) {
|
||||
// see if there is any evidence that we were expecting but didn't see
|
||||
for height, misbehavior := range node.Misbehaviors {
|
||||
_, ok := seenEvidence[height]
|
||||
require.True(t, ok, "expected evidence for %v misbehavior at height %v by node but was never found",
|
||||
require.Truef(t, ok, "expected evidence for %v misbehavior at height %v by node but was never found",
|
||||
misbehavior, height)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -40,7 +40,7 @@ func TestNet_Peers(t *testing.T) {
|
||||
}
|
||||
|
||||
for name := range seen {
|
||||
require.True(t, seen[name], "node %v not peered with %v", node.Name, name)
|
||||
require.Truef(t, seen[name], "node %v not peered with %v", node.Name, name)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ func TestValidator_Propose(t *testing.T) {
|
||||
valSchedule.Increment(1)
|
||||
}
|
||||
|
||||
require.False(t, proposeCount == 0 && expectCount > 0,
|
||||
require.Falsef(t, proposeCount == 0 && expectCount > 0,
|
||||
"node did not propose any blocks (expected %v)", expectCount)
|
||||
require.Less(t, expectCount-proposeCount, 5,
|
||||
require.Lessf(t, expectCount-proposeCount, 5,
|
||||
"validator missed proposing too many blocks (proposed %v out of %v)", proposeCount, expectCount)
|
||||
})
|
||||
}
|
||||
@@ -109,14 +109,14 @@ func TestValidator_Sign(t *testing.T) {
|
||||
signCount++
|
||||
}
|
||||
} else {
|
||||
require.False(t, signed, "unexpected signature for block %v", block.LastCommit.Height)
|
||||
require.Falsef(t, signed, "unexpected signature for block %v", block.LastCommit.Height)
|
||||
}
|
||||
valSchedule.Increment(1)
|
||||
}
|
||||
|
||||
require.False(t, signCount == 0 && expectCount > 0,
|
||||
require.Falsef(t, signCount == 0 && expectCount > 0,
|
||||
"node did not sign any blocks (expected %v)", expectCount)
|
||||
require.Less(t, float64(expectCount-signCount)/float64(expectCount), 0.5,
|
||||
require.Lessf(t, float64(expectCount-signCount)/float64(expectCount), 0.5,
|
||||
"validator missed signing too many blocks (signed %v out of %v)", signCount, expectCount)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user