diff options
author | Lauro Neto <lauro.neto@openbossa.org> | 2011-03-29 17:26:57 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:15:19 -0300 |
commit | c5fd9d9dbb33bc4ddbf68315d6b15dc274f076cd (patch) | |
tree | 7795da56d99a417d6ec3cc087e8a3eeaae43b1da /tests/samplebinding/typesystem_sample.xml | |
parent | 7c35c7788ab02d2d77cbc022d6cf181e7542d995 (diff) |
Tests for reverse operators
CPython calls nb_and with swapped arguments
for reverse operators.
This tests checks if the reverse operator
raises NotImplementedError instead of TypeError
when there isn't a valid reverse operator.
Raising TypeError would cause the operator to fail.
Diffstat (limited to 'tests/samplebinding/typesystem_sample.xml')
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index b5ffb5703..85187c53f 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -1297,6 +1297,26 @@ </add-function> </object-type> + <value-type name="Filter" /> + <value-type name="Data"> + <add-function signature="operator&(const Union&)" return-type="Intersection"> + <inject-code class="target"> + Intersection inter = *%CPPSELF & %1; + return %CONVERTTOPYTHON[Intersection](inter); + </inject-code> + </add-function> + </value-type> + <enum-type name="Data::Field" /> + <value-type name="Union"> + <add-function signature="operator&(const Data&)" return-type="Intersection"> + <inject-code class="target"> + Intersection inter = *%CPPSELF & %1; + return %CONVERTTOPYTHON[Intersection](inter); + </inject-code> + </add-function> + </value-type> + <value-type name="Intersection" /> + <!-- type used in abstract method --> <object-type name="HideType" generate="no" /> |