(fix): finalize v2 contracts (tests): cover v2 migration (doc): prepare release guidance
This commit is contained in:
+5
-5
@@ -12,7 +12,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.scuroneko.dev/scuroneko/laniakea/tgapi"
|
||||
"git.scuroneko.dev/scuroneko/laniakea/v2/tgapi"
|
||||
"git.scuroneko.dev/scuroneko/sneklog/v2"
|
||||
)
|
||||
|
||||
@@ -966,8 +966,8 @@ func TestAddPluginsAndRuntimeRegistrationsNoOpAfterRunStarts(t *testing.T) {
|
||||
bot := &Bot[NoData]{
|
||||
logger: sneklog.NewLogger(),
|
||||
prefixes: []string{"/"},
|
||||
middlewares: []Middleware[NoData]{NewMiddleware("base", func(ctx *MessageContext, db NoData) bool { return true })},
|
||||
runners: []Runner[NoData]{NewRunner("base", func(bot *Bot[NoData]) error { return nil })},
|
||||
middlewares: []Middleware[NoData]{NewMiddleware("base", func(*MessageContext, NoData) bool { return true })},
|
||||
runners: []Runner[NoData]{NewRunner("base", func(context.Context, *Bot[NoData]) error { return nil })},
|
||||
}
|
||||
plugin := NewPlugin[NoData]("late")
|
||||
|
||||
@@ -977,8 +977,8 @@ func TestAddPluginsAndRuntimeRegistrationsNoOpAfterRunStarts(t *testing.T) {
|
||||
defer bot.finishRun()
|
||||
|
||||
bot.AddPlugins(plugin)
|
||||
bot.AddMiddleware(NewMiddleware("late", func(ctx *MessageContext, db NoData) bool { return true }))
|
||||
bot.AddRunner(NewRunner("late", func(bot *Bot[NoData]) error { return nil }))
|
||||
bot.AddMiddleware(NewMiddleware("late", func(*MessageContext, NoData) bool { return true }))
|
||||
bot.AddRunner(NewRunner("late", func(context.Context, *Bot[NoData]) error { return nil }))
|
||||
|
||||
if len(bot.plugins) != 0 {
|
||||
t.Fatalf("expected AddPlugins to be ignored after configuration freeze, got %d plugins", len(bot.plugins))
|
||||
|
||||
Reference in New Issue
Block a user