]> git.giacomolli.uk - onechat/blobdiff - telegram_test.go
Check test assertions with testifylint
[onechat] / telegram_test.go
index 48e550392fee45ad3f8ceef0e7e02cb6deeb0372..5ced143eae9b1d8dbd55916ead35f3e6becdc4cc 100644 (file)
@@ -223,7 +223,7 @@ func TestBotStartsAtTheStoredOffset(t *testing.T) {
        terminal.WaitFor(t, "[connected to OneChat]")
        telegramWaitForSent(t, telegram, "ok")
 
        terminal.WaitFor(t, "[connected to OneChat]")
        telegramWaitForSent(t, telegram, "ok")
 
-       require.Equal(t, float64(10), telegram.Calls()[0].params["offset"])
+       require.InDelta(t, float64(10), telegram.Calls()[0].params["offset"], 0)
        require.NotContains(t, terminal.Output(), "handled before the restart")
 
        require.Eventually(t, func() bool {
        require.NotContains(t, terminal.Output(), "handled before the restart")
 
        require.Eventually(t, func() bool {
@@ -569,7 +569,7 @@ func TestRefusedRichPartGoesWithTheTextAsWritten(t *testing.T) {
                require.LessOrEqual(t, telegramUTF16Units(text), telegramMessageUnits)
        }
 
                require.LessOrEqual(t, telegramUTF16Units(text), telegramMessageUnits)
        }
 
-       require.True(t, reply == strings.Join(fallback, "")+telegramUnescapeTags(rich[0]), "reply is not sent once and whole")
+       require.Equal(t, reply, strings.Join(fallback, "")+telegramUnescapeTags(rich[0]), "reply is not sent once and whole")
 }
 
 func TestRefusedEntitiesGoAgainAsPlainText(t *testing.T) {
 }
 
 func TestRefusedEntitiesGoAgainAsPlainText(t *testing.T) {