当我为此模块运行以下测试时,测试失败。
当我在转义序列"\e(U"中添加换行符时,测试通过了。
为什么这个转义序列会以这种方式导致测试失败?
package My_Module;
use Win32::Console::ANSI;
print "\e(U"; # dissables the so-called ANSI to OEM conversion
# print "\e(U\n" # written this way, the test passes.
1;
use Test::More tests => 1;
BEGIN { use_ok( 'My_Module' ) || print "Bail out!\n" }
diag( "Testing My_Module, Perl $], $^X" );
结果:
C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/00-load.t .. # Testing My_Module, Perl 5.018001, C:\strawberry\perl\bin\perl.exe
t/00-load.t .. Failed 1/1 subtests
Test Summary Report
-------------------
t/00-load.t (Wstat: 0 Tests: 0 Failed: 0)
Parse errors: Bad plan. You planned 1 tests but ran 0.
Files=1, Tests=0, 1 wallclock secs ( 0.03 usr + 0.05 sys = 0.08 CPU)
Result: FAIL
Failed 1/1 test programs. 0/0 subtests failed.
dmake: Error code 255, while making 'test_dynamic'