From c21539b67978aa9c5ad362587d04188afb6d24d9 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Mon, 28 Dec 2015 11:57:16 -0800 Subject: [PATCH] Clean up old test files and rebuild MANIFEST --- MANIFEST | 36 +++-- syntax-test | 111 ------------- test-topics/rpg.txt | 296 ----------------------------------- test-topics/test-topics.rive | 85 ---------- unicode.rive | 10 -- 5 files changed, 21 insertions(+), 517 deletions(-) delete mode 100644 syntax-test delete mode 100644 test-topics/rpg.txt delete mode 100644 test-topics/test-topics.rive delete mode 100644 unicode.rive diff --git a/MANIFEST b/MANIFEST index 541087b..5f56b50 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,24 +1,30 @@ -Changes -Makefile.PL -MANIFEST -README.md -INSTALL.md -LICENSE -testsuite.rive -rpmbuild bin/rivescript +Changes +CONTRIBUTING.md +docs/bin-rivescript.html +docs/JavaScript.html +docs/JavaScript.pod +docs/RiveScript-WD.html docs/rivescript.css docs/RiveScript.html -docs/RiveScript-WD.html -docs/JavaScript.pod -docs/JavaScript.html -docs/bin-rivescript.html -t/RiveScript.t +docs/Tutorial.html +docs/Tutorial.pod +INSTALL.md lib/RiveScript.pm -lib/RiveScript/WD.pm lib/RiveScript/demo/admin.rive lib/RiveScript/demo/begin.rive lib/RiveScript/demo/clients.rive lib/RiveScript/demo/eliza.rive lib/RiveScript/demo/myself.rive -META.yml Module meta-data (added by MakeMaker) +lib/RiveScript/demo/perl.rive +lib/RiveScript/demo/rpg.rive +lib/RiveScript/WD.pm +LICENSE +Makefile.PL +MANIFEST +META.yml Module meta-data (added by MakeMaker) +perl-RiveScript.spec.tt +README.md +rpmbuild +t/RiveScript.t +testsuite.rive diff --git a/syntax-test b/syntax-test deleted file mode 100644 index cec116a..0000000 --- a/syntax-test +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use warnings; -use lib "lib"; -use RiveScript; - -print "Testing syntax checker\n"; - -my $lines = { - # ! Definition - '!' => [ - 'type name = value', # pass - 'version 2.00', # error - 'version = 2.00', # pass - 'var name = Aiden', # pass - 'sub who\'s = who is', # pass - 'varage = 0', # error - 'var age=0', # pass - 'var gender =androgynous', # pass - 'var generator=RiveScript', # pass - 'array colors =red green blue', # pass - ], - - # > Label - '>' => [ - 'begin inherits topic', # error - 'begin', # pass - 'begin ', # error (IRL, the end space would be stripped) - 'begin', # pass - 'topic alpha', # pass - 'topic alpha inherits beta', # pass - 'topic HelloWorld', # error - 'topic @test inherits @beta', # error - 'topic begin', # pass (technically legal) - 'object md5sum perl', # pass - 'object md5sum', # pass (legal) - 'object MD5_Sum', # error - 'object md5sum JavaScript', # error - 'object @google Perl', # error - 'object search-google perl', # error - ], - - # + Trigger - '+' => [ - 'hello bot', # pass - 'are you a bot', # pass - 'my name is *', # pass - '* told me to say *', # pass - 'what is your [home] phone number', # pass - 'what is your [home phone number', # error - 'hello) world', # error - 'hello( world', # error - 'My name is Kirsle', # error - 'what\'s up?', # error - 'are you (okay|alright)', # pass - '(are you|you) (okay|alright)', # pass - 'i am wearing a (@colors) shirt', # pass - 'my favorite color is (@colors', # error - 'i have a @colors colored *', # pass - 'google *', # pass - 'Google *', # error - 'google *{weight=100}', # pass - '* or not', # pass - '', # error! - 'body { background-color: blue; }', # error - ], - - # - Response - '-' => [ - 'Hello human!', # pass - 'Hello [ - 'in a nonchalant sort of way.\n', - 'With her forcefield around her,\n', - 'The Spider, the bounder,\n', - 'Is not in the picture today.', - ], - - # * Condition - '*' => [ - ' eq male => You told me you were a boy.', # pass - ' eq => Yes, you are my master.', # pass - ' eq => I know your name already.', # pass - ' ne undefined => Did you change your name?', # pass - '5 < 6 => yes', # pass - '5 !== 7 => wtf', # error - 'hello world', # error - 'hello == => test', # I dunno? - ], -}; -$lines->{'%'} = $lines->{'+'}; -$lines->{'@'} = $lines->{'+'}; - -my $rs = new RiveScript(); -foreach my $symbol (sort { $a cmp $b } keys %{$lines}) { - foreach my $line (@{$lines->{$symbol}}) { - print "Test: $symbol $line\n"; - - my $syntax = $rs->checkSyntax($symbol,$line); - if ($syntax) { - print "\tResult: $syntax\n"; - } - else { - print "\tOK!\n"; - } - } -} diff --git a/test-topics/rpg.txt b/test-topics/rpg.txt deleted file mode 100644 index 6f380af..0000000 --- a/test-topics/rpg.txt +++ /dev/null @@ -1,296 +0,0 @@ -! version = 2.00 - -// This file tests topic inclusions and inheritence: -// -// includes: this means that the topic "includes" the triggers present -// in another topic. Matching triggers in the source and included -// topic are possible, and the *reply* in the source topic overrides -// the reply in the included topic. -// inherits: all triggers in the source topic have higher matching priority than -// all triggers in the inherited topic. So if the source topic has a -// trigger of simply *, it means NO triggers can possibly match on the -// inherited topic, because '*' goes higher in the match list. - -// Aliases -! sub n = north -! sub w = west -! sub s = south -! sub e = east - -// This gets us into the game. -+ rpg demo -- You're not playing the game.{topic=nasa_lobby}{@look} - -// Global triggers available everywhere -> topic global - + help - - Commands that might be helpful:\n\n - ^ look: Give a description of the current room.\n - ^ exits: List the exits of the current room.\n - ^ north, south, east, west, up, down: Go through an exit.\n - ^ inventory: Display your inventory. - - + inventory - - Your inventory: - - + exit - - Logging out of the game. TODO - - + _ * - - You don't need to use the word "" in this game. - - + * - - I'm not sure what you're trying to do. - - // The following triggers get overridden on a room-by-room basis. - + look - - There is nothing special in this room. - - + exits - - There are no exits to this room. - - + north - - You can't go in that direction. - - + west - - You can't go in that direction. - - + south - - You can't go in that direction. - - + east - - You can't go in that direction. - - + up - - You can't go in that direction. - - + down - - You can't go in that direction. -< topic - -///////////// -// World Topics: all the "rooms" in our game inherit their triggers from these -// "world" topics. The world topics include the triggers from the global topic -///////////// - -// Global triggers available on Earth -> topic earth includes global - + breathe - - There is plenty of oxygen here so breathing is easy! - - + what world (is this|am i on) - - You are on planet Earth right now. -< topic - -// Global triggers available on Mars -> topic mars includes global - + breathe - - Thanks to your space suit you can breathe. There's no oxygen on this planet. - - + what world (is this|am i on) - - You are on planet Mars right now. -< topic - -///////////// -// Earth rooms: all these rooms are on Earth and their inherit the earth topic -// above. This means you can type "breathe" and "what world is this?" from every -// room on Earth. -///////////// - -// The NASA building on Earth -> topic nasa_lobby inherits earth - // All of these triggers have higher matching priority than all other - // triggers from the other topics, because this topic inherits a topic. So - // the matching list looks like this: - // exits - // north - // look - // (combined triggers from earth & global) - // Because our "north" is near the top of the match list, ours always gets - // called. But if we try saying "south", we end up matching the "south" from - // the global topic. - + look - - You are in the lobby of a NASA launch base on Earth. {@exits} - - + exits - - There is an elevator to the north. - - + north - - {topic=elevator}{@look} -< topic - -// Elevator in NASA building on earth -> topic elevator inherits earth - + look - - You are in the elevator that leads to the rocket ship. {@exits} - - + exits - - Up: the path to the rocket\n - ^ Down: the NASA lobby - - + up - - {topic=walkway}{@look} - - + down - - {topic=nasa_lobby}{@look} -< topic - -// Path to the rocket -> topic walkway inherits earth - + look - - You are on the walkway that leads to the rocket. {@exits} - - + exits - - The rocket is to the north. The elevator is to the south. - - + north - - {topic=rocket}{@look} - - + south - - {topic=elevator}{@look} -< topic - -// Rocket ship -> topic rocket inherits earth - + look - - You are on the rocket. There is a button here that activates the rocket. {@exits} - - + exits - - The walkway back to the NASA base is to the south. - - + south - - {topic=walkway}{@look} - - + (push|press) button - - You push the button and the rocket activates and flies into outer space. The - ^ life support system comes on, which includes an anesthesia to put you to sleep\s - ^ for the duration of the long flight to Mars.\n\n - ^ When you awaken, you are on Mars. The space shuttle seems to have crash-landed.\s - ^ There is a space suit here.{topic=crashed} -< topic - -// Crashed on Mars -> topic crashed inherits mars - + look - - You are in the ruins of your space shuttle. There is a space suit here. The\s - ^ door to the shuttle is able to be opened to get outside. - - + open door - * == 1 => You open the door and step outside onto the red Martian surface.{topic=crashsite}{@look} - - You can't go outside or you'll die. There's no oxygen here. - - + (take|put on) (space suit|suit|spacesuit) - * == 1 => You are already wearing the space suit. - - You put on the space suit. Now you can breathe outside with this. - - + exits - - The only exit is through the door that leads outside. -< topic - -// Martian surface -> topic crashsite inherits mars - + look - - You are standing on the red dirt ground on Mars. There is nothing but desert in all directions. - - + exits - - You can go in any direction from here; there is nothing but desert all around. - - + north - - {topic=puzzle1}{@look} - - + east - @ look - - + west - @ look - - + south - @ look -< topic - -// Puzzle on Mars. The sequence to solve the puzzle is: -// north, west, west, north. -// Topic "puzzle" is a placeholder that sets all the directions to return -// us to the crash site. puzzle inherits mars so that puzzle's directions -// will override the directions of mars. All the steps of the puzzle then -// "include" puzzle, and override only one direction. e.g. since "west" -// exists in puzzle1, the response from puzzle1 is given, but if you're -// in puzzle1 and type "north"... north was included from "puzzle", but -// puzzle1 doesn't have a reply, so the reply from "puzzle" is given. - -> topic puzzle inherits mars - // Provides common directional functions for wandering around on Mars. - + north - - {topic=crashsite}{@look} - - + east - - {topic=crashsite}{@look} - - + west - - {topic=crashsite}{@look} - - + south - - {topic=crashsite}{@look} -< topic - -> topic puzzle1 includes puzzle - + look - - You wander to a part of the desert that looks different than other parts of the desert. - - // We get 'exits' from crashsite - - + west - - {topic=puzzle2}{@look} -< topic - -> topic puzzle2 includes puzzle - + look - - This part looks even more different than the rest of the desert. - - + west - - {topic=puzzle3}{@look} -< topic - -> topic puzzle3 inherits mars puzzle - + look - - Now this part is even MORE different. Also there is a space colony nearby. - - + north - - {topic=entrance}{@look} -< topic - -> topic entrance inherits mars - + look - - You're standing at the entrance to a space colony. {@exits} - - + exits - - The entrance to the space colony is to the north. - - + north - - {topic=vaccuum}{@look} -< topic - -> topic vaccuum inherits mars - + look - - You're in the air lock entrance to the space colony. {@exits} - - + exits - - The inner part of the space colony is to the north. The martian surface is to the south. - - + north - - {topic=colony}{@look} - - + south - - {topic=vaccuum}{@look} -< topic - -> topic colony inherits mars - + look - - You've made it safely to the space colony on Mars. This concludes the game. - - + exits - - There are no exits here. - - + * - - This is the end of the game. There's nothing more to do. -< topic diff --git a/test-topics/test-topics.rive b/test-topics/test-topics.rive deleted file mode 100644 index de5f266..0000000 --- a/test-topics/test-topics.rive +++ /dev/null @@ -1,85 +0,0 @@ -! version = 2.00 - -> begin - + request - - {ok} -< begin - -+ * -- Outside of any topics: star trigger - -+ hello -- Hello there. - -+ test override -- Putting you into a topic that overrides "random"{topic=almostrandom} - -+ test override with star -- Putting you into a topic that overrides "random" and has a * trigger{topic=overridestar} - -+ test inc -- Putting you into the inc topic{topic=inc} - -+ test -- You are not in any topic (proof: ) - -+ exit -@ test - -> topic almostrandom inherits random - + test - - You are in the "almostrandom" topic (proof: ) - - + exit - - Leaving the "almostrandom" topic{topic=random} -< topic - -> topic overridestar inherits random - + test - - You are in the "overridestar" topic (proof: ) - - + exit - - Leaving the "overridestar" topic{topic=random} - - + * - - This is the wildcard inside "overridestar" -< topic - -> topic inc includes random - + test - - You are in the "inc" topic (proof: ) -< topic - -// test merging includes with inherits - -> topic alpha - + alpha trigger - - Alpha response. - - + abc - - abc -< topic - -> topic beta - + beta trigger - - Beta response. - - + xyz - - xyz -< topic - -> topic gamma - + gamma trigger - - Gamma response. - - + aaa - - aaa -< topic - -> topic mytest includes alpha beta inherits gamma - + mytest trigger - - Mytest response. - - + bbb - - bbb -< topic diff --git a/unicode.rive b/unicode.rive deleted file mode 100644 index 75881ce..0000000 --- a/unicode.rive +++ /dev/null @@ -1,10 +0,0 @@ -! version = 2.0 - -+ my email address is * -- >I will remember your e-mail is . - -+ what is my email -- Your email address is . - -+ comment ça va -- Je vais très bien, merci.