# New Ticket Created by  magnolia k 
# Please include the string:  [perl #126646]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=126646 >


A warning message is displayed when the test using the 'cmp-ok' failed.

$ cat cmp.t 
use v6;
use Test;

cmp-ok(1, '==', 2);

done-testing;

$ perl6 cmp.t 
not ok 1 - 

# Failed test at cmp.t line 4
# expected: '2'
Sub+{<anon|140414387279056>}+{Precedence} object coerced to string (please use 
.gist or .perl to do that)  in block  at lib/Test.pm:199
#  matcher: 'infix:<==>'
#      got: '1'
1..1
# Looks like you failed 1 test of 1


In cmp-ok of Test.pm, as pointed out in the warning message, it seems to be 
because trying to display the code reference.

multi sub cmp-ok(Mu $got, $op, Mu $expected, $desc = '') is export {

...

    if $op ~~ Callable ?? $op !! try EVAL "&infix:<$op>" -> $matcher {
        $ok = proclaim(?$matcher($got,$expected), $desc);
        if !$ok {
            diag "expected: '{$expected // $expected.^name}'";
            diag " matcher: '$matcher'";

Reply via email to