Skip to content

Commit

Permalink
Initial commit of adding grammar tests to y-bot, more to follow
Browse files Browse the repository at this point in the history
  • Loading branch information
keiffster committed May 18, 2017
1 parent e08309f commit 45603df
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
86 changes: 86 additions & 0 deletions bots/y-bot/tests/core/aimlstandardlibrary.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
"XFALSE X", "FALSE"
"XTRUE X", "TRUE"
"XNUMBER 1", "1"
"XNUMBER X", "Sorry, I don't have an answer for that!!"
"XSTRING X", "X"
"XSTRING X@Y", "X AT Y"
"XISTRUE TRUE", "TRUE"
"XISTRUE FALSE", "FALSE"
"XISTRUE 6", "FALSE"
"XISFALSE FALSE", "TRUE"
"XISFALSE TRUE", "FALSE"
"XISFALSE 7", "FALSE"
"XISNUMBER 1", "TRUE"
"XISNUMBER X", "FALSE"
"XTYPEOF 1", "XNUMBER"
"XTYPEOF X", "XSTRING"
"XTYPEOF TRUE", "XBOOL"

"XADD 1 XS 2", "3"
"XADD 1 XS 0", "1"

"XSUB 10 XS 3", "7"
"XSUB 0 XS 1", "0"
"XSUB 2 XS 0", "2"

"XMUL 2 XS 2", "4"
"XMUL 2 XS 0", "0"

"XDIV 8 XS 4", "2"
"XDIV 0 XS 0", "undefined"
"XDIV 11 XS 0", "infinite"

"XMOD 11 XS 3", "2"
"XMOD 0 XS 0", "undefined"
"XMOD 11 XS 0", "infinite"

"XLT 1 XS 2", "TRUE"
"XLT 2 XS 1", "FALSE"

"XGT 3 XS 1", "TRUE"
"XGT 1 XS 3", "FALSE"

"XLE 1 XS 2", "TRUE"
"XLE 2 XS 1", "FALSE"
"XLE 2 XS 2", "TRUE"

"XGE 3 XS 1", "TRUE"
"XGE 3 XS 1", "TRUE"
"XGE 3 XS 3", "TRUE"

"XEQ 1 XS 0", "FALSE"
"XEQ 0 XS 1", "FALSE"
"XEQ 0 XS 0", "TRUE"

"XNE 1 XS 2", "TRUE"
"XNE 2 XS 1", "TRUE"
"XNE 1 XS 1", "FALSE"

"XNOT TRUE", "FALSE"
"XNOT FALSE", "TRUE"

"XXLENGTH X XS 0", "1"
"XXLENGTH X Y XS 0", "1"

"XLENGTH", "0"
"XLENGTH HELLO", "5"
"XLENGTH HELLO THERE", "10"

"XRANDOM", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
"XSUBSTRING ROSEMARY XS 4", "MARY"

"XMAX 7", "7"
"XMAX 1 2 3", "3"

"XMIN 1 2 3", "1"

"XCAR 1 2 3", "1"
"XCDR 1 2 3", "2 3"
"XIMPLODE 1 2 3", "123"
"XREVERSE 1 2 3", "3 2 1"
"XBLACKHOLE", ""

"XLOOP KEIFF XS 1", "KEIFF"
"XLOOP KEIFF XS 3", "KEIFF KEIFF KEIFF"

"XCOUNT 1 2 3", "3"
4 changes: 4 additions & 0 deletions bots/y-bot/tests/core/bot_profile.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"FIRST NAME", "My first name is Y."
"MIDDLE NAME", "My middle name is AIML."
"LAST NAME", "My last name is BoT."
"FULL NAME", "My full name is Y-Bot."
2 changes: 2 additions & 0 deletions bots/y-bot/tests/core/config.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"XSET ENV TEST", "Environment is TEST"
"XSET DEVICE TEST", "Device is TEST"
6 changes: 6 additions & 0 deletions bots/y-bot/tests/core/pand_system.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"RUBBISH", "Sorry, I don't have an answer for that!"
"BRAIN VERSION", "Y-Bot 0.0.1"
"PROGRAM VERSION", "Y-Bot 0.0.1"
"BRAIN BUILD", "Y-Bot 0.0.1"
"AIML MATCH LIMIT XXX", "Match limit exceeded"
"AIML MATCH FAIL XXX", "Match failed"
8 changes: 8 additions & 0 deletions bots/y-bot/y-bot_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/sh

clear

export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.

python3 ../../src/programy/clients/test_runner.py --test_dir ./tests --config ./config.yaml --cformat yaml --logging ./logging.yaml --debug

0 comments on commit 45603df

Please sign in to comment.