diff --git a/Basic/lib/PDL/Course.pod b/Basic/lib/PDL/Course.pod index db747d767..1acb6857e 100644 --- a/Basic/lib/PDL/Course.pod +++ b/Basic/lib/PDL/Course.pod @@ -409,10 +409,6 @@ seem to fit anywhere above. =over -=item * L - -Explains how things changed from PDL 1.x to PDL 2.x - =item * L Supposed to be a uniform interface to plotting 2D graphics. @@ -422,7 +418,7 @@ Supposed to be a uniform interface to plotting 2D graphics. Covers data flow, a cool feature to be sure, but from what I can tell it is not currently supported. -=item * L +=item * L PDL started before Perl 5.6, which introduce subs that could return lvalues. I'm pretty sure that this module has been rolled into the core @@ -458,4 +454,3 @@ distribute and/or modify this document under the same terms as the current Perl license. See: http://dev.perl.org/licenses/ - diff --git a/Basic/t/lvalue.t b/Basic/t/lvalue.t index de370d700..55e6b4bdd 100644 --- a/Basic/t/lvalue.t +++ b/Basic/t/lvalue.t @@ -4,19 +4,26 @@ use Test::More; use Test::Exception; use PDL::LiteF; +use PDL::Dbg; use PDL::Lvalue; -ok (PDL::Lvalue->subs('slice'),"slice is an lvalue sub"); +my @lv_subs = map [$_], qw( + dice flat indexND broadcast nslice_if_pdl px range reorder reshape + sever slice indexNDb mslice +); +push @lv_subs, map [$_, 1], qw(clump dummy index unbroadcast); +push @lv_subs, map [$_, pdl 1], qw(where whereND); +push @lv_subs, map [$_, 0, 1], qw(diagonal); +push @lv_subs, map [$_, 0, 0], qw(dice_axis index2d mv xchg); +push @lv_subs, map [$_, pdl([0]), undef, undef], qw(rangeb); -my $pa = sequence 10; -lives_ok { - $pa->slice("") .= 0; -} "lvalue slice ran OK"; +my $pa = sequence 3,3; +for (@lv_subs) { + my ($name, @args) = @$_; + no warnings 'uninitialized'; + lives_ok { $pa->$name(@args) .= 0 } "lvalue @$_ ran OK"; +} is($pa->max, 0, "lvalue slice modified values"); -lives_ok { - $pa->broadcast(0) .= 1; -} "lvalue broadcast ran OK"; - done_testing;