這裏有測試的輸出。Test :: Builder :: Tester失敗測試失敗,爲什麼?
prove -lv t/02-fail.t
t/02-fail.t ..
not ok 1
1..1
# Failed test at t/02-fail.t line 15.
# STDOUT is:
# ok 1 - corpus/fail/FooBar.pm version 1.0.1 is valid
# not ok 2 - corpus/fail/FooBarBaz.pm version is valid
#
# not:
# ok 1 - corpus/fail/FooBar.pm version 1.0.1 is valid
#
# not ok 2 - corpus/fail/FooBarBaz.pm version is valid
#
# as expected
# STDERR is:
# # Failed test 'corpus/fail/FooBarBaz.pm version is valid'
# # at /home/xenoterracide/projects/Test-HasValidVersion/lib/Test/HasValidVersion.pm line 60.
# # corpus/fail/FooBarBaz.pm VERSION is not a valid verion
#
# not:
#
# as expected
Failed 1/1 subtests
Test Summary Report
-------------------
t/02-fail.t (Wstat: 0 Tests: 1 Failed: 1)
Failed test: 1
Files=1, Tests=1, 0 wallclock secs (0.02 usr 0.01 sys + 0.04 cusr 0.01 csys = 0.08 CPU)
Result: FAIL
和測試本身
#!/usr/bin/perl
use 5.006;
use strict;
use warnings;
use Test::Builder::Tester;
use Test::More;
use Test::HasValidVersion qw(version_all_ok);
test_out('ok 1 - corpus/fail/FooBar.pm version 1.0.1 is valid',
'not ok 2 - corpus/fail/FooBarBaz.pm version is valid'
);
version_all_ok('corpus/fail');
test_test;
done_testing;
(注:這裏的github repository測試代碼有一點點不同,但未能對同一模塊的鏈接沒有任何不同。如果。你克隆回購請確保你簽出提交daaab6a7c452958399f74150406915657f2cfa33作爲主分支正在更新)
我不知道爲什麼這是失敗的,它似乎是注入整條線docs別提。
有人可以幫助我糾正代碼,使其通過?
也許你可以給作者發郵件。否則,你可以使用Test :: Tester來代替嗎? – dwarring 2011-05-10 06:06:33
@snoopy我是作者......除非你的意思是Test :: Builder :: Tester的作者 – xenoterracide 2011-05-10 11:42:51
是的,那就是我的意思 – dwarring 2011-05-11 01:31:01