xerbot 0.1.1 : xb.commandes("led,seuil") déclare les sorties (state.cmds) ; test 9/9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R75H65SynGwRG5vBSoYeZ1
This commit is contained in:
cloudion
2026-11-04 19:50:41 +00:00
parent 5452df71a7
commit a361215dcf
7 changed files with 25 additions and 7 deletions

View File

@@ -23,5 +23,7 @@ int main() {
OK(s.out.find("\"state\":{\"online\":true}") != std::string::npos, "hello → l'état");
s.out.clear(); std::string longue(5000, 'a'); s.in = longue + "\n{\"cmd\":\"ping\",\"id\":\"z\"}\n"; xb.loop();
OK(s.out.find("\"id\":\"z\"") != std::string::npos, "une ligne trop longue est jetée, la suivante passe");
Stream s2; Xerbot x2("d2", "radar"); x2.battement(0); x2.commandes("led, seuil"); x2.begin(s2);
OK(s2.out.find("\"cmds\":[\"led\",\"seuil\"]") != std::string::npos, "commandes() → state.cmds : " + s2.out);
std::cout << "xerbot : " << n << "/" << n << "\n"; return 0;
}