From 4bce18d00d812d86c5dc589e023555b70e033694 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Wed, 18 Jul 2018 20:15:48 -0400 Subject: [PATCH] [v6.d REVIEW] Add multi-no-match.t APPENDIX The tests in this file ensure certain constructs die with a decent error instead of hanging or crashing by spilling compiler guts. Since there's yet no existing behaviour for some of such combinations, X::Multi::NoMatch is thrown. This APPENDIX test file is for such tests. --- APPENDICES/A02-some-day-maybe/multi-no-match.t | 17 +++++++++++++++++ S32-array/splice.t | 6 +----- 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 APPENDICES/A02-some-day-maybe/multi-no-match.t diff --git a/APPENDICES/A02-some-day-maybe/multi-no-match.t b/APPENDICES/A02-some-day-maybe/multi-no-match.t new file mode 100644 index 0000000000..19eee32f01 --- /dev/null +++ b/APPENDICES/A02-some-day-maybe/multi-no-match.t @@ -0,0 +1,17 @@ +use v6; +use Test; + +# The tests in this file ensure certain constructs die with a decent error +# instead of hanging or crashing by spilling compiler guts. +# +# Since there's yet no existing behaviour for some of such combinations, +# X::Multi::NoMatch is thrown. This APPENDIX test file is for such tests. + +plan 2; + +{ # RT #129773 + throws-like { [].splice: 0, [] }, X::Multi::NoMatch, + '.splice(offset, array) throws'; + throws-like { [].splice: 0e0, 0 }, X::Multi::NoMatch, + '.splice(wrong type offset...) throws'; +} diff --git a/S32-array/splice.t b/S32-array/splice.t index 926b787f40..c6228c3e59 100644 --- a/S32-array/splice.t +++ b/S32-array/splice.t @@ -45,7 +45,7 @@ my @testing = # $@Num, Array[Num], # need way to handle named params in capture ; -plan (@testing/2 * 54) + 16; +plan (@testing/2 * 54) + 14; for @testing -> @a, $T { my $toNum = @a.of ~~ Num; @@ -257,10 +257,6 @@ for @testing -> @a, $T { # RT #129773 { - throws-like { [].splice: 0, [] }, X::Multi::NoMatch, - '.splice(offset, array) throws'; - throws-like { [].splice: 0e0, 0 }, X::Multi::NoMatch, - '.splice(wrong type offset...) throws'; lives-ok { [].splice: *, {42;} }, 'splice(Whatever, Callable) lives'; lives-ok { [].splice: *, {42;}, [42] }, 'splice(Whatever, Callable, @a) lives'; }