Mercurial > pytave
changeset 182:0bf4b7cf16ee
maint: Use Octave coding style conventions for unit tests
* pycall.cc, pyeval.cc: Use Octave coding conventions.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Sat, 04 Jun 2016 12:56:57 -0700 |
parents | fa76167d5929 |
children | 2b03585d4ddd |
files | pycall.cc pyeval.cc |
diffstat | 2 files changed, 13 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/pycall.cc Sat Jun 04 12:50:50 2016 -0700 +++ b/pycall.cc Sat Jun 04 12:56:57 2016 -0700 @@ -183,8 +183,7 @@ /* %!test -%! pyexec (strjoin({'def pyfunc(x):', -%! ' return 2*x'}, '\n')); -%! z = pycall ('pyfunc', [20 20]); -%! assert (z == [40 40]) +%! pyexec ("def pyfunc(x):\n return 2*x"); +%! z = pycall ("pyfunc", [20 20]); +%! assert (z, [40 40]) */
--- a/pyeval.cc Sat Jun 04 12:50:50 2016 -0700 +++ b/pyeval.cc Sat Jun 04 12:56:57 2016 -0700 @@ -106,21 +106,21 @@ /* %!test -%! q = pyeval ('10.1') -%! assert (isnumeric(q)) +%! q = pyeval ("10.1"); +%! assert (isnumeric (q)) %! % note: floating-point equality test: usually bad but here we expect the exact same float %! assert (q, 10.1) %!test -%! q = pyeval ('"I <3 Octave"') +%! q = pyeval ("\"I <3 Octave\""); %! assert (ischar (q)) -%! assert (~strcmp (q, '1 <3 Octave')) +%! assert (! strcmp (q, "1 <3 Octave")) %!test -%! % This might change if we stop converting lists -%! z = pyeval ('[1, [21, 22], 3, [41, [421, 422], 43]]'); -%! assert (z{2}{1} == 21) -%! assert (z{2}{2} == 22) -%! assert (z{4}{2}{1} == 421) -%! assert (z{4}{2}{2} == 422) +%! % FIXME: this will change when we stop converting lists +%! z = pyeval ("[1, [21, 22], 3, [41, [421, 422], 43]]"); +%! assert (z{2}{1}, 21) +%! assert (z{2}{2}, 22) +%! assert (z{4}{2}{1}, 421) +%! assert (z{4}{2}{2}, 422) */