# HG changeset patch # User Mike Miller # Date 1471380865 25200 # Node ID fe6b9e618c98d165eeb31463c0e24df417d4cbaa # Parent 6bd8f5e3542a9934e2433855fb0418c8b613138a Add %!xtests for known failures due to bugs in Octave * @py/py.m, @pyobject/pyobject.m, @pyobject/subsasgn.m, @pyobject/subsref.m: Add %!xtests for known failures due to bugs in Octave. diff -r 6bd8f5e3542a -r fe6b9e618c98 @py/py.m --- a/@py/py.m Tue Aug 16 12:57:07 2016 -0700 +++ b/@py/py.m Tue Aug 16 13:54:25 2016 -0700 @@ -52,3 +52,8 @@ %! else %! assert (isobject (py.long (2^100))) %! endif + +## Cannot use '@' to make a handle to a Python function +%!xtest +%! fn = @py.math.abs; +%! assert (fn (-3), 3) diff -r 6bd8f5e3542a -r fe6b9e618c98 @pyobject/pyobject.m --- a/@pyobject/pyobject.m Tue Aug 16 12:57:07 2016 -0700 +++ b/@pyobject/pyobject.m Tue Aug 16 13:54:25 2016 -0700 @@ -341,6 +341,12 @@ %!error double (pyobject ()) %!error double (pyeval ("[1, 2, 3]")) +## Octave fails to resolve function overloads via function handles +%!xtest +%! fn = @double; +%! x = pyobject (int64 (42)); +%! assert (fn (x), double (x)) + %!error (isequal (pyobject ())) %!assert (! isequal (pyobject (1.2), 1.2)) %!assert (isequal (pyobject ("a string"), pyobject ("a string"))) diff -r 6bd8f5e3542a -r fe6b9e618c98 @pyobject/subsasgn.m --- a/@pyobject/subsasgn.m Tue Aug 16 12:57:07 2016 -0700 +++ b/@pyobject/subsasgn.m Tue Aug 16 13:54:25 2016 -0700 @@ -128,3 +128,8 @@ %! assert (A{1, 3}, 30) %! assert (A{2, 1}, 40) %! assert (A{2, 2}, 5) + +## Test of string key assignment, fails in the general case +%!xtest +%! d = pyobject (struct ()); +%! d{"value"} = 1; diff -r 6bd8f5e3542a -r fe6b9e618c98 @pyobject/subsref.m --- a/@pyobject/subsref.m Tue Aug 16 12:57:07 2016 -0700 +++ b/@pyobject/subsref.m Tue Aug 16 13:54:25 2016 -0700 @@ -253,6 +253,19 @@ %! a = L{2}; %! assert (char (a), "None") +## Test of multi-element indexing, fails to return correct number of output args +%!xtest +%! a = {1, 2, 3, 4, 5, 6}; +%! b = pyobject (a); +%! b{:}; +%! assert (ans, a{end}) + +%!xtest +%! a = {1, 2, 3, 4, 5, 6}; +%! b = pyobject (a); +%! c = {b{:}}; +%! assert (c, a) + %!error %! f = pyeval ("abs"); %! f{1}