From: "Martin J. Dürst" Date: 2022-03-14T08:52:39+09:00 Subject: [ruby-core:107885] Re: Fwd: [ruby-cvs:91197] 8f59482f5d (master): add some tests for Unicode Version 14.0.0 Hello Benoit, Many thanks for your help. On 2022-03-13 21:15, Benoit Daloze wrote: > It's simply the guard is incorrect, it needs to say ">= 3.1 and < 3.2", so > `ruby_version_is "3.1"..."3.2" do`, > not just `ruby_version_is "3.1" do` which means ">= 3.1" (so includes 3.2, > 3.3, etc). > I thought it'd be pretty obvious from the previous guards, but apparently > not. Sorry, but very much not so. In all the previous guards, there is either more than one version in the textual description, and the `ruby_version_is` method takes a range, or the textual description mentions only one version, and the `ruby_version_is` method takes a single parameter. So there is no way to conclude,��or��even��guess, from the available examples that �� ruby_version_is "3.1" actually means "for Ruby 3.1 and higher" rather than "for Ruby 3.1". In addition to that, there's the issue of the meaning of the word "is". The meaning of the word "is" is rarely disputed (the most famous instance of when that has happened may be with ex-president Clinton, see e.g. https://slate.com/news-and-politics/1998/09/bill-clinton-and-the-meaning-of-is.html). > We might change the usages from `ruby_version_is "3.1" do` to > `ruby_version_is "3.1"... do` to make this clearer in the future. What we have do do is not only change the arguments to the `ruby_version` method from "3.1" to "3.1"..., but we have to make sure that 'is' actually means 'is'. So `ruby_version_is "3.1"` should only use its block when the��version��*is* actually 3.1(.x), not for any past or future versions. Code that doesn't say what it does, but says something else, is just bad code. And it's even worse if on the next line, it says exactly the same thing (it "is 13.1 for Ruby 3.1") again. And this is worsened by the fact that this is spec (as opposed to test), where supposedly words are used to mean what they they mean so that everything is easily readable and understandable. So to summarize: Two instances of telling me the check is exactly��for 3.1, and no examples that would make me suspect it means anything else. I strongly suggest the meaning of `ruby_version_is` be changed so that it *means* what it *says*. I'll submit a bug report if you want. I also suggest that a new method, maybe called "ruby_version_is_or_later" (proposals for better names appreciated). As a quick band-aid, I'm changing ruby_version_is "3.2" do it "is 14.0.0 for Ruby 3.2" do RbConfig::CONFIG['UNICODE_VERSION'].should == "14.0.0" end end to ruby_version_is "3.2" do it "is 14.0.0 for Ruby 3.2 or later" do RbConfig::CONFIG['UNICODE_VERSION'].should == "14.0.0" end end Note the addition of "or later" in the textual description. This way, at least the text says what the spec does, even if the code still doesn't really do so (yet, I���hope). I also have added a comment to make sure this doesn't get missed again. Regards, Martin. > On Sun, Mar 13, 2022 at 2:16 AM Martin J. D��rst > wrote: > >> Hello Benoit, others, >> >> Some CI checks fail as below (see e.g. >> https://github.com/ruby/ruby/runs/5524900743?check_suite_focus=true) >> with a version mismatch. >> My understanding was that we are now on Ruby 3.2, so it's unclear why in >> these tests, Ruby thinks it's still Ruby 3.1. When I checked before >> submitting with `make check`, there were no such errors. >> >> Regards, Martin. >> >> 1) >> RbConfig::CONFIG['UNICODE_EMOJI_VERSION'] is 13.1 for Ruby 3.1 FAILED >> Expected "14.0" == "13.1" >> to be truthy but was false >> >> /home/runner/work/ruby/ruby/src/spec/ruby/library/rbconfig/unicode_emoji_version_spec.rb:25:in >> >> `block (3 levels) in ' >> >> /home/runner/work/ruby/ruby/src/spec/ruby/library/rbconfig/unicode_emoji_version_spec.rb:4:in >> >> `' >> >> 2) >> RbConfig::CONFIG['UNICODE_VERSION'] is 13.0.0 for Ruby 3.1 FAILED >> Expected "14.0.0" == "13.0.0" >> to be truthy but was false >> >> /home/runner/work/ruby/ruby/src/spec/ruby/library/rbconfig/unicode_version_spec.rb:25:in >> >> `block (3 levels) in ' >> >> /home/runner/work/ruby/ruby/src/spec/ruby/library/rbconfig/unicode_version_spec.rb:4:in >> >> `' >> >> Finished in 46.945332 seconds >> >> 3823 files, 30988 examples, 131590 expectations, 2 failures, 0 >> errors, 0 tagged >> make: *** [uncommon.mk:865: yes-test-spec] Error 1 >> Error: Process completed with exit code 2. >> >> On 2022-03-13 10:05, Martin J. D��rst wrote: >>> To everybody taking care of continuous integration: >>> >>> Please note that your CI may need new cached data files for Unicode >>> Version 14.0.0 / Emoji Version 14.0. These files do not get downloaded >>> in a usual compilation of Ruby to avoid lots of unneeded network traffic. >>> >>> Regards, Martin. >>> >>> >>> -------- Forwarded Message -------- >>> Subject: [ruby-cvs:91197] 8f59482f5d (master): add some tests for >>> Unicode Version 14.0.0 >>> Date: Sun, 13 Mar 2022 09:41:37 +0900 (JST) >>> From: Martin D��rst >>> To: ruby-cvs@ruby-lang.org >>> >>> Martin D��rst 2022-03-12 21:33:51 +0900 (Sat, 12 Mar 2022) >>> >>> New Revision: 8f59482f5d >>> >>> https://github.com/ruby/ruby/commit/8f59482f5d >>> >>> Log: >>> add some tests for Unicode Version 14.0.0 >>> >>> Modified files: >>> test/ruby/test_regexp.rb >>> test/ruby/test_string.rb. >>> >>> Unsubscribe: > ?subject=unsubscribe> >>> >> >> > -- Prof. Dr.sc. Martin J. D��rst Department of Intelligent Information Technology College of Science and Engineering Aoyama Gakuin University Fuchinobe 5-1-10, Chuo-ku, Sagamihara 252-5258 Japan Unsubscribe: