!7 p-exp { test1(); test2(); } svoid test1 { BakedBot bot = bakedBotWithRules([[ inputContainsTokens("=>") && !inputStartsWith("!rule ") => output(Should I store this rule?) ]]); bot.setAuthorized(true); bot.check("bla => blubb", "Should I store this rule?"); assertEqualsVerbose("", unnull(callAnswerMethod(bot, "bla <= blubb"))); assertEqualsVerbose("Rule saved. Have 2 rules.", callAnswerMethod(bot, "!rule bla => bla")); } svoid test2 { BakedBot bot = bakedBotWithRules([[ input(what is $chicken $wire?) => output(a $wire made from $chicken) ]]); bot.check("what is pork sausage?", "a sausage made from pork"); } svoid test3 { BakedBot bot = bakedBotWithRules([[ ]]); bot.setList("Fact-to-fact rules", [[ fact($gertrude is a $sheep) && fact($sheep are $afraid_of_wolves) => fact($gertrude is $afraid_of_wolves) ]]); bot.setList("Random Facts", [[ klaus is a sheep ]]); bot.answerAuthed("!deriveFacts"); assertTrueVerbose(nempty(print(bot.lists.get("Derived facts")))); }