fix reminder test after reformat

This commit is contained in:
Chris Sexton 2021-12-22 02:58:13 -05:00
parent ed6c7e08e7
commit 8b38429a31
1 changed files with 6 additions and 12 deletions

View File

@ -212,30 +212,24 @@ func TestCancelMiss(t *testing.T) {
func TestLimitList(t *testing.T) { func TestLimitList(t *testing.T) {
c, mb, td := setup(t) c, mb, td := setup(t)
defer td() defer td()
c.config.Set("Reminder.MaxBatchAdd", "10") c.config.Set("Reminder.MaxBatchAdd", "100")
c.config.Set("Reminder.MaxList", "25") c.config.Set("Reminder.MaxList", "25")
assert.NotNil(t, c) assert.NotNil(t, c)
//Someone can redo this with a single batch add, but I can't locally due to an old version of sqllite (maybe). //Someone can redo this with a single batch add, but I can't locally due to an old version of sqllite (maybe).
res := c.message(makeMessage("!remind testuser every 1h for 10h don't fail this test")) res := c.message(makeMessage("!remind testuser every 1h for 30h don't fail this test"))
assert.True(t, res)
res = c.message(makeMessage("!remind testuser every 1h for 10h don't fail this test"))
assert.True(t, res)
res = c.message(makeMessage("!remind testuser every 1h for 10h don't fail this test"))
assert.True(t, res) assert.True(t, res)
res = c.message(makeMessage("!list reminders")) res = c.message(makeMessage("!list reminders"))
assert.True(t, res) assert.True(t, res)
assert.Len(t, mb.Messages, 4) assert.Len(t, mb.Messages, 2)
assert.Contains(t, mb.Messages[0], "Sure tester, I'll remind testuser.") assert.Contains(t, mb.Messages[0], "Sure tester, I'll remind testuser.")
assert.Contains(t, mb.Messages[1], "Sure tester, I'll remind testuser.")
assert.Contains(t, mb.Messages[2], "Sure tester, I'll remind testuser.")
for i := 0; i < 25; i++ { for i := 0; i < 25; i++ {
assert.Contains(t, mb.Messages[3], fmt.Sprintf("%d) tester -> testuser :: don't fail this test", i+1)) assert.Contains(t, mb.Messages[1], fmt.Sprintf("%d) tester -> testuser :: don't fail this test", i+1))
} }
assert.Contains(t, mb.Messages[3], "more...") assert.Contains(t, mb.Messages[1], "more...")
assert.NotContains(t, mb.Messages[3], "26) tester -> testuser") assert.NotContains(t, mb.Messages[1], "26) tester -> testuser")
} }
func TestHelp(t *testing.T) { func TestHelp(t *testing.T) {