我正在尝试为使用此代码抛出异常的函数进行测试:
use v6; use Test; plan *; use lib "lib"; use Math::ConvergenceMethods; sub f ($x) {return $x + 1;} { is-approx: bisection(&f,-2,0),-1; dies-ok: { bisection(&f,3,2) },"Incorrect arguments"; } done-testing;
当我运行它时它会返回此警告:
WARNINGS for /home/antonio/Code/perl6/Math-ConvergenceMethods/t/bisection.t: Useless use of "-" in expression "-1" in sink context (line 13) Useless use of constant string "Incorrect arguments" in sink context (lines 14,14)
我该如何解决?