diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-31 19:45:17 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-02 15:14:36 +0900 |
| commit | dc886873bcc294e41242016ce1aa30406a98853b (patch) | |
| tree | b8b5e2b1b514bdb8a43e9110d5e0601672bf890f /test/t | |
| parent | 70ee9363671ff5aead633807b9579dab22f94cf3 (diff) | |
| download | mruby-dc886873bcc294e41242016ce1aa30406a98853b.tar.gz mruby-dc886873bcc294e41242016ce1aa30406a98853b.zip | |
Replace `R-assignment` by `single-line pattern matching`.
Since `R-assignment` in CRuby is abandoned. Single-line pattern matching
in `mruby` only matches single local variable at the moment. Currently
it works as a right assignment to a local variable. It will be enhanced
in the future.
Diffstat (limited to 'test/t')
| -rw-r--r-- | test/t/syntax.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/test/t/syntax.rb b/test/t/syntax.rb index a52e0dcea..ae698c385 100644 --- a/test/t/syntax.rb +++ b/test/t/syntax.rb @@ -345,13 +345,9 @@ assert('splat object in assignment') do assert_equal [2], (a = *o) end -assert('right-ward assignment') do +assert('one-line pattern match') do 1 => a assert_equal(1, a) - 13.divmod(5) => a,b - assert_equal([2,3], [a, b]) - 13.divmod(5) => a,b => c, d - assert_equal([2,3,2,3], [a, b, c, d]) end assert('splat object in case statement') do |
