Skip to content

Test failure with Ruby 1.9 #580

@tueda

Description

@tueda

Some tests fail when using Ruby 1.9. The cause is the special character \R in regular expressions, introduced when Onigmo became the regular expression engine in Ruby 2.0.0.

Ruby 1.9.3:
$ ruby --version
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]

$ ./check/check.rb Issue567_1 build/sources/vorm
./check/check.rb:1134: warning: Insecure world writable dir /mnt/c in PATH, mode 040777
warning: failed to get the wordsize of 'build/sources/vorm'
warning: assuming wordsize = 4
Check /home/tueda/work/form/build/sources/vorm
FORM 5.0.0-beta.1 (Nov 14 2024, v5.0.0-beta.1-81-g0289435)  Run: Mon Nov 18 15:29:06 2024
Run options:

# Running tests:


===============================================================================
Issue567_1 (fixes.frm:2883) FAILED
===============================================================================
FORM 5.0.0-beta.1 (Nov 14 2024, v5.0.0-beta.1-81-g0289435)  Run: Mon Nov 18 15:29:06 2024
    CF rat;
    Vector v;
    PolyRatFun rat;
    Local F = rat(v,1);
    .end
ERROR: polynomials and polyratfuns must contain symbols only
Program terminating at 1.frm Line 4 -->
  0.00 sec out of 0.00 sec
===============================================================================

F

Finished tests in 0.002681s, 372.9789 tests/s, 372.9789 assertions/s.

  1) Failure:
test_Issue567_1(Test_Issue567_1) [/tmp/form_check_20241118-293396-i6jhl4/fixes.rb:2891]:
Failed assertion, no message given.

1 tests, 1 assertions, 1 failures, 0 errors, 0 skips
Ruby 2.0.0:
$ ruby --version
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]

$ ./check/check.rb Issue567_1 build/sources/vorm
./check/check.rb:1134: warning: Insecure world writable dir /mnt/c in PATH, mode 040777
warning: failed to get the wordsize of 'build/sources/vorm'
warning: assuming wordsize = 4
Check /home/tueda/work/form/build/sources/vorm
FORM 5.0.0-beta.1 (Nov 14 2024, v5.0.0-beta.1-81-g0289435)  Run: Mon Nov 18 15:30:10 2024
Run options:

# Running tests:

Finished tests in 0.003367s, 297.0301 tests/s, 297.0301 assertions/s.
1 tests, 1 assertions, 0 failures, 0 errors, 0 skips

ruby -v: ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]

A possible fix is to expand \R into (?>\x0D\x0A|[\x0A-\x0D\u{85}\u{2028}\u{2029}]) or simply (?>\x0D\x0A|[\x0A-\x0D]).

Alternatively, Ruby 1.9.3 reached EOL on 2015-02-23, nearly 10 years ago, so it is a reasonable option to set the minimum requirement to Ruby 2.0.0 (or a more recent version).

For reference, the default versions of Ruby included in old Ubuntu are:

Ubuntu Ruby
14.04 ruby 1.9.3p484 (2013-11-22 revision 43786)
16.04 ruby 2.3.1p112 (2016-04-26)
18.04 ruby 2.5.1p57 (2018-03-29 revision 63029)
20.04 ruby 2.7.0p0 (2019-12-25 revision 647ee6f091)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions