aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-02 01:40:27 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-02 01:40:27 +0000
commit29c5a3b89c5127edd7754d2105ef64c88ac29566 (patch)
tree45c1acba31c10e0ed9491a7e45f81d36532790ec /bootstraptest
parent3f109150e03e5922667e58552f15435ef5799c0f (diff)
downloadruby-29c5a3b89c5127edd7754d2105ef64c88ac29566.tar.gz
* parse.y (negate_lit): add T_RATIONAL and T_COMPLEX to the switch
statement, and call rb_bug() if an unknown type is passed to negate_lit(). [ruby-core:56316] [Bug #8717] * bootstraptest/test_literal_suffix.rb (assert_equal): add test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_literal_suffix.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/bootstraptest/test_literal_suffix.rb b/bootstraptest/test_literal_suffix.rb
index 29ce8e05b3..5f86904128 100644
--- a/bootstraptest/test_literal_suffix.rb
+++ b/bootstraptest/test_literal_suffix.rb
@@ -3,6 +3,8 @@ assert_equal '0/1', '0r'
assert_equal 'Rational', '0r.class'
assert_equal '1/1', '1r'
assert_equal 'Rational', '1r.class'
+assert_equal '-1/1', '-1r'
+assert_equal 'Rational', '(-1r).class'
assert_equal '1/1', '0x1r'
assert_equal 'Rational', '0x1r.class'
assert_equal '1/1', '0b1r'
@@ -15,6 +17,8 @@ assert_equal '1/1', '01r'
assert_equal 'Rational', '01r.class'
assert_equal '6/5', '1.2r'
assert_equal 'Rational', '1.2r.class'
+assert_equal '-6/5', '-1.2r'
+assert_equal 'Rational', '(-1.2r).class'
assert_equal '0+0i', '0i'
assert_equal 'Complex', '0i.class'
assert_equal '0+1i', '1i'