我有以下代码:
#!/usr/bin/perl
use Test::Simple tests => 2;
$file = "lalaletc";
$file2 = "lalal";
ok($file =~ m/^lala/);
ok($file2 =~ m/^lala$/);
输出如下:
1..2
ok 1
not ok 2
# Failed test at ./test.pl line 7.
# Looks like you failed 1 test of 2.
但是 $file2 没有更多字符了,所以我希望它能够成功测试 2。为什么没有呢?