# HG changeset patch # User Abhinav Tripathi # Date 1470209204 25200 # Node ID f2b4576879a6a368bf753d8c61e413c776df17fc # Parent 49832ca978fdf7be82ff01612ca0c91117be7984 Edit tests in subsref to use and verify cell indexing * @pyobject/subsref.m: Edit an existing test to use the available cell indexing syntax and also add a test to verify that None is returned if nargout > 0 diff -r 49832ca978fd -r f2b4576879a6 @pyobject/subsref.m --- a/@pyobject/subsref.m Wed Aug 03 00:22:20 2016 -0700 +++ b/@pyobject/subsref.m Wed Aug 03 00:26:44 2016 -0700 @@ -119,11 +119,11 @@ %! assert (L{1}, 10) %! assert (L{2}, 20) -%!xtest +%!test %! % list indexing, slice %! pyexec ("L = [10, 20, [30, 40]]") %! L = pyobject.fromPythonVarName ("L"); -%! L2 = L{:}; +%! [L2{1:length(L)}] = L{:}; %! assert (L2{1}, 10) %! assert (L2{2}, 20) %! assert (L2{3}{1}, 30) @@ -242,6 +242,12 @@ %! f (); %! assert (length (ans) == 3) +%!test +%! % ensure None is returned if nargout > 0 +%! L = pyeval ("[1, None, 3]"); +%! a = L{2}; +%! assert (char (a), "None") + %!error %! % multiple return values: too many outputs %! f = pyeval ("lambda: (1, 2)");