diff options
| author | Mark Dickinson <dickinsm@gmail.com> | 2008-07-02 09:37:01 (GMT) |
|---|---|---|
| committer | Mark Dickinson <dickinsm@gmail.com> | 2008-07-02 09:37:01 (GMT) |
| commit | 70c3289085d08d97edbfaa626efc2d2c2ac21859 (patch) | |
| tree | 4a60e0d0005acbc8ea36dea5e408aa6d43b8d2a7 /Lib/test/test_decimal.py | |
| parent | 8bb8fa5dd679d1f4086fac4d3181f0985c14006d (diff) | |
| download | cpython-70c3289085d08d97edbfaa626efc2d2c2ac21859.zip cpython-70c3289085d08d97edbfaa626efc2d2c2ac21859.tar.gz cpython-70c3289085d08d97edbfaa626efc2d2c2ac21859.tar.bz2 | |
Replace occurrences of '\d' with '[0-9]' in Decimal regex, to make sure
that the behaviour of Decimal doesn't change if/when re.UNICODE becomes
assumed in Python 3.0.
Also add a check that alternative Unicode digits (e.g. u'\N{FULLWIDTH
DIGIT ONE}') are *not* accepted in a numeric string.
Diffstat (limited to 'Lib/test/test_decimal.py')
| -rw-r--r-- | Lib/test/test_decimal.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 17c6373..74304f7 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -432,6 +432,9 @@ class DecimalExplicitConstructionTest(unittest.TestCase): self.assertEqual(str(Decimal(u'-Inf')), '-Infinity') self.assertEqual(str(Decimal(u'NaN123')), 'NaN123') + #but alternate unicode digits should not + self.assertEqual(str(Decimal(u'\uff11')), 'NaN') + def test_explicit_from_tuples(self): #zero |
