Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Game2048: Fixed overtriggering (#4473)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
urohit011 authored and moollaza committed Sep 5, 2017
1 parent fd27120 commit 50bb72d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/DDG/Goodie/Game2048.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
5 changes: 4 additions & 1 deletion t/Game2048.t
Original file line number Diff line number Diff line change
Expand Up @@ -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

);

Expand Down

0 comments on commit 50bb72d

Please sign in to comment.