diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-05 07:44:25 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-05 07:44:25 +0900 |
| commit | d47003aea406e1e48ef79efd61b17d5121c4c6b9 (patch) | |
| tree | 18b6767371f8ffc0aadc1847e7f9dbe9c87aebd9 /test | |
| parent | d9e253255218b04fd54a55980c4d8b6d61b1697c (diff) | |
| download | mruby-d47003aea406e1e48ef79efd61b17d5121c4c6b9.tar.gz mruby-d47003aea406e1e48ef79efd61b17d5121c4c6b9.zip | |
Fixed a bug in argument number check with kwargs; fix #4159
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/syntax.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/t/syntax.rb b/test/t/syntax.rb index 883cbd1ba..603547c7c 100644 --- a/test/t/syntax.rb +++ b/test/t/syntax.rb @@ -471,6 +471,10 @@ this is a comment that has extra after =begin and =end with tabs after it end assert 'keyword arguments' do + def m(a, b:1) [a, b] end + assert_equal [1, 1], m(1) + assert_equal [1, 2], m(1, b: 2) + def m(a, b:) [a, b] end assert_equal [1, 2], m(1, b: 2) assert_raise(ArgumentError) { m b: 1 } |
