<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_pattern_matching.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Update ruby test for colon-style hash inspect</title>
<updated>2024-10-03T09:47:09+00:00</updated>
<author>
<name>tompng</name>
<email>tomoyapenguin@gmail.com</email>
</author>
<published>2024-06-07T15:23:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7237af75d2aa700454fbaba9bda7a9283413d903'/>
<id>7237af75d2aa700454fbaba9bda7a9283413d903</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix TestPatternMatching#test_deconstruct_keys test</title>
<updated>2024-05-14T06:43:28+00:00</updated>
<author>
<name>Andrew Konchin</name>
<email>andry.konchin@gmail.com</email>
</author>
<published>2024-05-10T09:28:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b60f09442a0220e2fc053de020fdc58b642f851e'/>
<id>b60f09442a0220e2fc053de020fdc58b642f851e</id>
<content type='text'>
Before the change `C.keys` returned keys captured in some previous test case that by chance captured `nil` value what made this test passed successfully. Now it returns keys captured in this test case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before the change `C.keys` returned keys captured in some previous test case that by chance captured `nil` value what made this test passed successfully. Now it returns keys captured in this test case.
</pre>
</div>
</content>
</entry>
<entry>
<title>Support NODE_ONCE for pattern matching</title>
<updated>2024-03-04T03:33:00+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2024-02-01T10:50:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2d8788e90cd535933c0f444112d465cffc4c71b1'/>
<id>2d8788e90cd535933c0f444112d465cffc4c71b1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Keep unused literal nodes</title>
<updated>2023-10-31T08:49:12+00:00</updated>
<author>
<name>yui-knk</name>
<email>spiketeika@gmail.com</email>
</author>
<published>2023-10-20T12:30:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=51149f335e4aea3465bd52a98f85351455bf320e'/>
<id>51149f335e4aea3465bd52a98f85351455bf320e</id>
<content type='text'>
For static analysis, it’s better to keep unused literal nodes.
If simply change `block_append` to fall through, both "unused literal ignored"
and "possibly useless use of a literal in void context" warnings
are shown for the same line. But it’s verbose then remove
"unused literal ignored" warning.

This kind of optimization is already implemented on compile.c.
`compile_block` calls `iseq_compile_each0` with `popped = 1` when NODE_BLOCK
has next.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For static analysis, it’s better to keep unused literal nodes.
If simply change `block_append` to fall through, both "unused literal ignored"
and "possibly useless use of a literal in void context" warnings
are shown for the same line. But it’s verbose then remove
"unused literal ignored" warning.

This kind of optimization is already implemented on compile.c.
`compile_block` calls `iseq_compile_each0` with `popped = 1` when NODE_BLOCK
has next.
</pre>
</div>
</content>
</entry>
<entry>
<title>Pattern matching has not been experimental</title>
<updated>2023-09-05T02:52:34+00:00</updated>
<author>
<name>yui-knk</name>
<email>spiketeika@gmail.com</email>
</author>
<published>2023-09-02T12:50:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4a90c934278a0b1de11389dbbc208ee044117119'/>
<id>4a90c934278a0b1de11389dbbc208ee044117119</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>skip if `DidYouMean.formatter=` is not defined</title>
<updated>2023-04-16T00:26:56+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-04-15T18:58:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=29e01c6f5f8901bdaab818dfd4699cfa2a86b8e6'/>
<id>29e01c6f5f8901bdaab818dfd4699cfa2a86b8e6</id>
<content type='text'>
ruby/test_default_gems.rb can define empty `DidYouMean` module
because of the following line (second require) in the
`lib/did_you_mean/did_you_mean.gemspec`:

```ruby
begin
  require_relative "lib/did_you_mean/version"
rescue LoadError # Fallback to load version file in ruby core repository
  require_relative "version"
end
```

It defines only `::DidYouMean::VERSION`.

However, in the `test/ruby/test_patten_matching.rb` assumes that
if `defined?(DidYouMean)` is true, then there is a method `DidYouMean.formatter=`
and this assumption fails all tests in `test/ruby/test_patten_matching.rb` if
there is only a `::DidYouMean::VERSION`.

To reproduce the failures, we need to repeat the following command:

`make test-all TESTS='-v ruby/test_default_gems.rb ruby/pattern_matching'`

(because the ruby/test_default_gems.rb should be run before the ruby/pattern_matching`)

This patch introduces more strict gurds.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ruby/test_default_gems.rb can define empty `DidYouMean` module
because of the following line (second require) in the
`lib/did_you_mean/did_you_mean.gemspec`:

```ruby
begin
  require_relative "lib/did_you_mean/version"
rescue LoadError # Fallback to load version file in ruby core repository
  require_relative "version"
end
```

It defines only `::DidYouMean::VERSION`.

However, in the `test/ruby/test_patten_matching.rb` assumes that
if `defined?(DidYouMean)` is true, then there is a method `DidYouMean.formatter=`
and this assumption fails all tests in `test/ruby/test_patten_matching.rb` if
there is only a `::DidYouMean::VERSION`.

To reproduce the failures, we need to repeat the following command:

`make test-all TESTS='-v ruby/test_default_gems.rb ruby/pattern_matching'`

(because the ruby/test_default_gems.rb should be run before the ruby/pattern_matching`)

This patch introduces more strict gurds.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #19175] p_rest should be `assignable'</title>
<updated>2023-03-26T09:56:21+00:00</updated>
<author>
<name>Kazuki Tsujimoto</name>
<email>kazuki@callcc.net</email>
</author>
<published>2023-03-26T06:33:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6c0925ba7017efde6091e2ec4f1a6be268166696'/>
<id>6c0925ba7017efde6091e2ec4f1a6be268166696</id>
<content type='text'>
It should also check for duplicate names.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It should also check for duplicate names.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #19195] Allow optional newlines before closing parenthesis</title>
<updated>2022-12-13T09:06:11+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-12-13T06:18:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=764da87ab02d30c578138bdb0f37e7c18f2d4371'/>
<id>764da87ab02d30c578138bdb0f37e7c18f2d4371</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix unexpected "duplicated key name" error in paren-less one line pattern matching</title>
<updated>2022-09-09T05:00:27+00:00</updated>
<author>
<name>Kazuki Tsujimoto</name>
<email>kazuki@callcc.net</email>
</author>
<published>2022-09-09T05:00:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=db0e0dad1171456253ebd899e7e878823923d3d8'/>
<id>db0e0dad1171456253ebd899e7e878823923d3d8</id>
<content type='text'>
[Bug #18990]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #18990]
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #18890] Suppress warnings and fix the message</title>
<updated>2022-07-08T02:31:51+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-08T02:20:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4a2662ae8b9f64346af82551fdd6756e7497e2f1'/>
<id>4a2662ae8b9f64346af82551fdd6756e7497e2f1</id>
<content type='text'>
```
test/ruby/test_parse.rb:1384: warning: assigned but unused variable - obj
test/ruby/test_pattern_matching.rb:1162: warning: unused literal ignored
test/ruby/test_pattern_matching.rb:1165: warning: unused literal ignored
test/ruby/test_pattern_matching.rb:1161: warning: assigned but unused variable - a
test/ruby/test_pattern_matching.rb:1164: warning: assigned but unused variable - b
```

And a newline should be significant here.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
test/ruby/test_parse.rb:1384: warning: assigned but unused variable - obj
test/ruby/test_pattern_matching.rb:1162: warning: unused literal ignored
test/ruby/test_pattern_matching.rb:1165: warning: unused literal ignored
test/ruby/test_pattern_matching.rb:1161: warning: assigned but unused variable - a
test/ruby/test_pattern_matching.rb:1164: warning: assigned but unused variable - b
```

And a newline should be significant here.
</pre>
</div>
</content>
</entry>
</feed>
