You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it is useful to test the input against regexes. Let's try:
Code:
use Test;
cmp-ok �foo�, �~~�, /bar/, �Lorem ipsum.�
Result:
not ok 1 - Lorem ipsum.
# Failed test 'Lorem ipsum.'
# at -e line 2
Regex object coerced to string (please use .gist or .perl to do that)
in sub cmp-ok at /home/�/�/C712FE6969F786C9380D643DF17E85D06868219E (Test) line 243
# expected: ''
# matcher: 'infix:<~~>'
# got: 'foo'
It �works�, but it attempts to turn a regex into a Str.
".gist" is probably the wrong answer in this case.
my @got = ‘one’, ‘two three’; say @got # OUTPUT: [one two three]
↑ Not very useful
On 2017-07-25 12:52:25, alex.jakimenko@gmail.com wrote:
Sometimes it is useful to test the input against regexes. Let's try:
Code:
use Test;
cmp-ok ‘foo’, ‘~~’, /bar/, ‘Lorem ipsum.’
Result:
not ok 1 - Lorem ipsum.
# Failed test 'Lorem ipsum.'
# at -e line 2
Regex object coerced to string (please use .gist or .perl to do that)
in sub cmp-ok at /home/…/…/C712FE6969F786C9380D643DF17E85D06868219E
(Test) line 243
# expected: ''
# matcher: 'infix:<~~>'
# got: 'foo'
It “works”, but it attempts to turn a regex into a Str.
Migrated from rt.perl.org#131797 (status was 'new')
Searchable as RT131797$
The text was updated successfully, but these errors were encountered: