summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYuki Yugui Sonoda <yugui@yugui.jp>2019-06-16 22:28:34 +0900
committerYuki Yugui Sonoda <yugui@yugui.jp>2019-06-16 22:43:03 +0900
commit44caca11cfa6bea01a1ef738846183f1a56d5658 (patch)
tree65538995ed3d9e6ef425b0c11c604bca1eebe991 /test
parent2fb1564c02899c73519164ddf3f2430dfbc8f3d6 (diff)
Make constant assignments more conforming to JIS X 3017:2013 11.4.2.2.3
compile.c (NODE_CDECL): Evaluate the module before the value test/ruby/test_const.rb (test_evaluation_order): added a test case
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_const.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_const.rb b/test/ruby/test_const.rb
index 8784e0e988..fa512aa437 100644
--- a/test/ruby/test_const.rb
+++ b/test/ruby/test_const.rb
@@ -69,4 +69,12 @@ PRE
def test_toplevel_lookup
assert_raise(NameError, '[Feature #11547]') {TestConst::Object}
end
+
+ def test_evaluation_order
+ assert_raise_with_message(RuntimeError, "recv", 'JIS X 3017:2013 11.4.2.2.3') {
+ eval <<~EOS
+ raise('recv')::C = raise('value')
+ EOS
+ }
+ end
end