diff --git a/Test.pm b/Test.pm index 715b401afbe..f5860feeccb 100644 --- a/Test.pm +++ b/Test.pm @@ -22,13 +22,6 @@ our $testing_started; ## test functions -# Compare numeric values with approximation -sub approx ($x, $y) { - my $epsilon = 0.00001; - my $diff = abs($x - $y); - ($diff < $epsilon); -} - # you can call die_on_fail; to turn it on and die_on_fail(0) to turn it off sub die_on_fail($fail=1) { $die_on_fail = $fail; diff --git a/src/setting/Any-str.pm b/src/setting/Any-str.pm index 5027f847553..a6046da1a8b 100644 --- a/src/setting/Any-str.pm +++ b/src/setting/Any-str.pm @@ -46,7 +46,10 @@ class Any is also { my $s = ~self; if $delimiter eq '' { return gather { - take $s.substr($_, 1) for 0 .. $s.chars - 1; + take $s.substr($_, 1) for 0 .. ($s.chars - 1 min $l - 2); + if $l <= $s.chars { + take $s.substr($l - 1 ); + }; } } return gather { @@ -93,8 +96,8 @@ class Any is also { } -sub split($delimiter, $target) { - $target.split($delimiter); +sub split($delimiter, $target, $limit = *) { + $target.split($delimiter, $limit); } # TODO: '$filename as Str' once support for that is in place diff --git a/src/setting/Match.pm b/src/setting/Match.pm index 007b8be662f..7f2f53f713d 100644 --- a/src/setting/Match.pm +++ b/src/setting/Match.pm @@ -12,6 +12,8 @@ class Match is also { take " # and for debugging purposes only\n"; } take $sp; + take "ast => {$.ast.perl},\n"; + take $sp; take "text => {$.text.perl},\n"; take $sp; take "from => $.from,\n"; diff --git a/t/spectest.data b/t/spectest.data index 3bcadb0894c..86ff7d05692 100644 --- a/t/spectest.data +++ b/t/spectest.data @@ -215,6 +215,7 @@ S09-subscript_slice/slice.t S10-packages/import.t S10-packages/use-with-class.t S11-modules/export.t +S11-modules/nested.t S12-attributes/class2.t S12-attributes/class.t S12-attributes/clone.t