(new): v1.2 release
Golang lint / lint (push) Successful in 11m32s

This commit is contained in:
2026-08-19 14:58:25 +03:00
parent f03a081ed6
commit 29b208eeec
79 changed files with 7301 additions and 2060 deletions
+20
View File
@@ -1037,3 +1037,23 @@ func TestSceneStoreErrorsPropagate(t *testing.T) {
}
})
}
func TestSceneSkipsNilHandlers(t *testing.T) {
scene := NewScene[NoData]("nil").
OnStep("step", nil).
OnCommand("command", nil).
OnPayload("payload", nil).
OnMessage(nil)
if len(scene.steps) != 0 || len(scene.commands) != 0 || len(scene.payloads) != 0 || scene.message != nil {
t.Fatal("scene registered a nil handler")
}
}
func TestApplySceneResultRejectsUnknownAction(t *testing.T) {
bot := &Bot[NoData]{sessionStore: NewMemorySessionStore()}
_, err := bot.applySceneResult(NewScene[NoData]("scene"), &SceneContext{}, SceneResult{Action: SceneAction(255)})
if !errors.Is(err, ErrInvalidSceneAction) {
t.Fatalf("expected ErrInvalidSceneAction, got %v", err)
}
}