diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | complex.c | 2 | ||||
-rw-r--r-- | test/ruby/test_complex.rb | 1 |
3 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Sat Nov 17 23:53:05 2012 Tadayoshi Funaba <[email protected]> + + * complex.c (make_patterns): should not accept extra sign. + Sat Nov 17 21:45:12 Luis Lavena <[email protected]> * win32/file.c (replace_to_long_name): skip expansion for all wildcard @@ -1506,7 +1506,7 @@ static VALUE comp_pat0, comp_pat1, comp_pat2, a_slash, a_dot_and_an_e, #define NUMBER "[-+]?" NUMERATOR "(?:\\/" DENOMINATOR ")?" #define NUMBERNOS NUMERATOR "(?:\\/" DENOMINATOR ")?" #define PATTERN0 "\\A" WS "(" NUMBER ")@(" NUMBER ")" WS -#define PATTERN1 "\\A" WS "([-+])?(" NUMBER ")?[iIjJ]" WS +#define PATTERN1 "\\A" WS "([-+])?(" NUMBERNOS ")?[iIjJ]" WS #define PATTERN2 "\\A" WS "(" NUMBER ")(([-+])(" NUMBERNOS ")?[iIjJ])?" WS static void diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index 332e026f0f..0a7828b85f 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -1154,6 +1154,7 @@ class Complex_Test < Test::Unit::TestCase assert_equal('-1.0-0.0i', Complex(-1.0, -0.0).to_s) assert_in_delta(Math::PI, Complex(-0.0).arg, 0.001) assert_equal(Complex(2e3, 2e4), '2e3+2e4i'.to_c) + assert_raise(ArgumentError){ Complex('--8i')} end def test_known_bug |