Mercurial > octave
annotate 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 |
rev | line source |
---|---|
28519
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 %!test |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 %! x = colon_op (); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 %! assert (x:2:3, "colon_op:double:double"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 %! assert (1:x:3, "double:colon_op:double"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 %! assert (1:2:x, "double:double:colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 %! assert (x:x:3, "colon_op:colon_op:double"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 %! assert (1:x:x, "double:colon_op:colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 %! assert (x:2:x, "colon_op:double:colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 %! assert (x:x:x, "colon_op:colon_op:colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 %! assert (x:2, "colon_op:double"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 %! assert (1:x, "double:colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 %! assert (x:x, "colon_op:colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 %!test |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 %! x = legacy_colon_op (); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 %! assert (x:2:3, "legacy_colon_op:double:double"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 %! assert (1:x:3, "double:legacy_colon_op:double"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 %! assert (1:2:x, "double:double:legacy_colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 %! assert (x:x:3, "legacy_colon_op:legacy_colon_op:double"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 %! assert (1:x:x, "double:legacy_colon_op:legacy_colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 %! assert (x:2:x, "legacy_colon_op:double:legacy_colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 %! assert (x:x:x, "legacy_colon_op:legacy_colon_op:legacy_colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 %! assert (x:2, "legacy_colon_op:double"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 %! assert (1:x, "double:legacy_colon_op"); |
d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 %! assert (x:x, "legacy_colon_op:legacy_colon_op"); |