Game2048: Fixed overtriggering (#4473)

* fixed overtriggering in Game2048

* Added two more tests to help fix issue #4473

* Added regex guard in handle function to fix #4473.

* modified regex guard for #4473

* Added a test to t/Game2048.t

* Removed trailing comma.
master
Rohit Upadhyay 2017-09-05 23:30:32 +05:30 committed by Zaahir Moolla
parent fd2712079b
commit 50bb72dff7
2 changed files with 5 additions and 2 deletions

View File

@ -9,7 +9,7 @@ triggers start => "2048", "play 2048", "game 2048";
handle query_lc => sub {
return unless $_;
return unless $_ =~ /^(2048|play 2048|game 2048)(\s+.*)*$/;
return '',
structured_answer => {

View File

@ -40,7 +40,10 @@ ddg_goodie_test(
),
'what is 2048?' => undef,
'how to play 2048' => undef,
'204823 34232' => undef
'204823 34232' => undef,
'123:play 2048:12398' => undef,
'2400:cb00:2048:1::6817:f2fe' => undef,
'2048:6093:99ca:bc7:0:0:0:0' => undef
);