diff test/colon-op/colon-op.tst @ 28519:d4563c5d4060

handle all dispatching for colon operator in do_colon_op function * ov.cc (do_colon_op): Handle all dispatching here, but using lookup based on argument vector passed to feval instead of determining dispatch type separately. * pt-colon.cc (tree_colon_expression::evaluate): Simply evaluate arguments and pass them to do_colon_op. * test/colon-op: New test directory. * test/module.mk: Update.
author John W. Eaton <jwe@octave.org>
date Mon, 29 Jun 2020 23:45:19 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/colon-op/colon-op.tst	Mon Jun 29 23:45:19 2020 -0400
@@ -0,0 +1,25 @@
+%!test
+%! x = colon_op ();
+%! assert (x:2:3, "colon_op:double:double");
+%! assert (1:x:3, "double:colon_op:double");
+%! assert (1:2:x, "double:double:colon_op");
+%! assert (x:x:3, "colon_op:colon_op:double");
+%! assert (1:x:x, "double:colon_op:colon_op");
+%! assert (x:2:x, "colon_op:double:colon_op");
+%! assert (x:x:x, "colon_op:colon_op:colon_op");
+%! assert (x:2, "colon_op:double");
+%! assert (1:x, "double:colon_op");
+%! assert (x:x, "colon_op:colon_op");
+
+%!test
+%! x = legacy_colon_op ();
+%! assert (x:2:3, "legacy_colon_op:double:double");
+%! assert (1:x:3, "double:legacy_colon_op:double");
+%! assert (1:2:x, "double:double:legacy_colon_op");
+%! assert (x:x:3, "legacy_colon_op:legacy_colon_op:double");
+%! assert (1:x:x, "double:legacy_colon_op:legacy_colon_op");
+%! assert (x:2:x, "legacy_colon_op:double:legacy_colon_op");
+%! assert (x:x:x, "legacy_colon_op:legacy_colon_op:legacy_colon_op");
+%! assert (x:2, "legacy_colon_op:double");
+%! assert (1:x, "double:legacy_colon_op");
+%! assert (x:x, "legacy_colon_op:legacy_colon_op");