<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_pattern_matching.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<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>
<entry>
<title>[Bug #18890] newline should be insignificant after pattern label</title>
<updated>2022-07-05T23:32:36+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-03T05:45:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=eaeb130b11fefe91aaf61f294ea32af76dada74f'/>
<id>eaeb130b11fefe91aaf61f294ea32af76dada74f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Find pattern is no longer experimental [Feature #18585]</title>
<updated>2022-02-19T09:45:49+00:00</updated>
<author>
<name>Kazuki Tsujimoto</name>
<email>kazuki@callcc.net</email>
</author>
<published>2022-02-19T09:45:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=db6b23c76cbc7888cd9a9912790c2068703afdd0'/>
<id>db6b23c76cbc7888cd9a9912790c2068703afdd0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Disable did_you_mean in TestPatternMatching</title>
<updated>2021-10-23T01:22:14+00:00</updated>
<author>
<name>Yuki Nishijima</name>
<email>yk.nishijima@gmail.com</email>
</author>
<published>2021-10-23T01:22:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=93badf47704eece8b7a2b084f18a03a9083fb1a8'/>
<id>93badf47704eece8b7a2b084f18a03a9083fb1a8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
