diff options
author | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-06 23:25:24 +0000 |
---|---|---|
committer | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-06 23:25:24 +0000 |
commit | 2e6b1d0cbb12abfb44980dd83f554c01f13888c1 (patch) | |
tree | aa7205a7d04b39834a62aee6088c419626d5f856 | |
parent | 113008a7aeaae78f0b4e52d7b17554fb353e4fd0 (diff) | |
download | ruby-2e6b1d0cbb12abfb44980dd83f554c01f13888c1.tar.gz |
* test/ruby/test_struct.rb: Add regression test for question marks and
bangs in struct members. [Closes GH-468]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_struct.rb | 12 |
2 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Sat Dec 7 08:25:00 2013 Richo Healy <richo@psych0tik.net> + + * test/ruby/test_struct.rb: Add regression test for question marks and + bangs in struct members. [Closes GH-468] + Fri Dec 6 19:33:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> * class.c (rb_extract_keywords, rb_get_kwargs): move from diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb index 0c4eafc14a..3d07d68066 100644 --- a/test/ruby/test_struct.rb +++ b/test/ruby/test_struct.rb @@ -284,6 +284,18 @@ module TestStruct assert_equal({a:1, b:2, c:3, d:4, e:5, f:6}, o.to_h) end + def test_question_mark_in_member + klass = @Struct.new(:a, :b?) + o = klass.new("test", true) + assert_true(o.b?) + end + + def test_bang_mark_in_member + klass = @Struct.new(:a, :b!) + o = klass.new("test", true) + assert_true(o.b!) + end + class TopStruct < Test::Unit::TestCase include TestStruct |