Skip to content

Commit 7ebbf20

Browse files
committed
Confirm prompt had bogus RegEx expressions. Missed adding a Unittest to the mocha test suite.
1 parent 3ab7f30 commit 7ebbf20

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

Node/lib/dialogs/EntityRecognizer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ var EntityRecognizer = (function () {
193193
}
194194
};
195195
EntityRecognizer.dateExp = /^\d{4}-\d{2}-\d{2}/i;
196-
EntityRecognizer.yesExp = /^(1|y|yes|yep|sure|ok|true)\z/i;
197-
EntityRecognizer.noExp = /^(0|n|no|nope|not|false)\z/i;
196+
EntityRecognizer.yesExp = /^(1|y|yes|yep|sure|ok|true)/i;
197+
EntityRecognizer.noExp = /^(0|n|no|nope|not|false)/i;
198198
EntityRecognizer.numberExp = /[+-]?(?:\d+\.?\d*|\d*\.?\d+)/;
199199
return EntityRecognizer;
200200
})();

Node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "botbuilder",
33
"author": "Microsoft Corp.",
44
"description": "Bot Builder is a dialog system for building rich bots on virtually any platform.",
5-
"version": "0.6.4",
5+
"version": "0.6.5",
66
"license": "MIT",
77
"keywords": [
88
"bots",

Node/src/dialogs/EntityRecognizer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ export interface IFindMatchResult {
6262

6363
export class EntityRecognizer {
6464
static dateExp = /^\d{4}-\d{2}-\d{2}/i;
65-
static yesExp = /^(1|y|yes|yep|sure|ok|true)\z/i;
66-
static noExp = /^(0|n|no|nope|not|false)\z/i;
65+
static yesExp = /^(1|y|yes|yep|sure|ok|true)/i;
66+
static noExp = /^(0|n|no|nope|not|false)/i;
6767
static numberExp = /[+-]?(?:\d+\.?\d*|\d*\.?\d+)/;
6868

6969
static findEntity(entities: IEntity[], type: string): IEntity {

Node/tests/Dialogs.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ describe('Dialogs', function() {
4343
},
4444
function (session, results) {
4545
assert(results.response && results.response.entity === 'green');
46+
builder.Prompts.confirm(session, 'Is green your choice?');
47+
},
48+
function (session, results) {
49+
assert(results.response && results.response === true);
4650
builder.Prompts.time(session, 'enter a time');
4751
},
4852
function (session, results) {
@@ -65,9 +69,12 @@ describe('Dialogs', function() {
6569
bot.processMessage({ text: 'green' });
6670
break;
6771
case 4:
68-
bot.processMessage({ text: 'in 5 minutes' });
72+
bot.processMessage({ text: 'yes' });
6973
break;
7074
case 5:
75+
bot.processMessage({ text: 'in 5 minutes' });
76+
break;
77+
case 6:
7178
assert(message.text == 'done');
7279
done();
7380
break;

0 commit comments

Comments
 (0)