From 1cd247e3564dc34d5ebc367b0f7d3c71050b6126 Mon Sep 17 00:00:00 2001 From: Paul Walko Date: Fri, 7 Jul 2017 04:28:10 +0000 Subject: [PATCH] .c bugfix --- modules/calc.py | 2 +- modules/test/test_calc.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/calc.py b/modules/calc.py index baa4be0..0328d2c 100644 --- a/modules/calc.py +++ b/modules/calc.py @@ -22,7 +22,7 @@ subs = [ ] r_google_calc = re.compile(r'calculator-40.gif.*? = (.*?)<') -r_google_calc_exp = re.compile(r'calculator-40.gif.*? = (.*?)(.*?)<') +r_google_calc_exp = re.compile(r'calculator-40.gif.*? = (.*?)(.*?)') def c(phenny, input): """Google calculator.""" diff --git a/modules/test/test_calc.py b/modules/test/test_calc.py index 13e4839..4a405be 100644 --- a/modules/test/test_calc.py +++ b/modules/test/test_calc.py @@ -36,3 +36,9 @@ class TestCalc(unittest.TestCase): c(self.phenny, input) self.phenny.reply.assert_called_once_with('Sorry, no result.') + + def test_c_quirk(self): + input = Mock(group=lambda x: '24/50') + c(self.phenny, input) + + self.phenny.say.assert_called_once_with('0.48')