changeset 343:fe6b9e618c98

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.
author Mike Miller <mtmiller@octave.org>
date Tue, 16 Aug 2016 13:54:25 -0700
parents 6bd8f5e3542a
children 9d95f087e5aa
files @py/py.m @pyobject/pyobject.m @pyobject/subsasgn.m @pyobject/subsref.m
diffstat 4 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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")))
--- 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;
--- 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 <cannot index Python object>
 %! f = pyeval ("abs");
 %! f{1}