我在5.8.8上有一个失败的测试,我不明白为什么,尤其是当它在更新的版本中工作时(可能它只是一个bug)(这里是一个link to the full code)正则表达式/ ms没有像预期的那样运行perl 5.8.8
use strict;
use warnings;
use Test::More;
my $fname = 'Fo';
my $content = do { local $/ ; <DATA> };
like $content, qr/^$fname $/xms, q[includes first name];
done_testing;
__DATA__
use strict;
use warnings;
use Test::More;
# generated by Dist::Zilla::Plugin::Test::PodSpelling bootstrapped version
eval "use Test::Spelling 0.12; use Pod::Wordlist::hanekomu; 1" or die [email protected];
add_stopwords(<DATA>);
all_pod_files_spelling_ok('bin', 'lib');
__DATA__
Fo
oer
bar
在所有最新版本的perl上这工作正常。但在5.8.8测试失败。我发现通过删除^
和$
该代码的工作原理,它像Perls正则表达式引擎忽略/m
,但the documentation表示它被支持。
为什么这不起作用?和什么是解决它的最正确的方法? (注意:我认为测试应该检查这些元素是否在一行上)
你的问题应该包含[足够的信息(http://sscce.org/)回答它没有去现场去做。 – TLP
@TLP它只是连接完整的代码,如果有人想看看它,除非我失去了一些东西,但我无法想象其他任何影响这一点。任何更多的问题可能是一个分心 – xenoterracide
我会争辩说,它不会。 “like”并不是我所知道的任何子程序,我的TAP的内容是水。 – TLP