Fix functors (wrapped as __call__) when using -builtin -modern -fastunpack.
This commit is contained in:
parent
bf85b6f7a9
commit
c6547ac44e
5 changed files with 57 additions and 1 deletions
12
Examples/test-suite/python/functors_runme.py
Normal file
12
Examples/test-suite/python/functors_runme.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from functors import *
|
||||
|
||||
a = Functor0(10)
|
||||
b = Functor1(10)
|
||||
c = Functor2(10)
|
||||
|
||||
if a()!=-10:
|
||||
raise RuntimeError("a failed")
|
||||
if b(1)!=11:
|
||||
raise RuntimeError("b failed")
|
||||
if c(1, 2)!=13:
|
||||
raise RuntimeError("c failed")
|
||||
|
|
@ -75,3 +75,10 @@ if not -a==a:
|
|||
if not -b==Op(-5):
|
||||
raise RuntimeError("-b==Op(-5)")
|
||||
|
||||
# test functors
|
||||
if not b()==5:
|
||||
raise RuntimeError("functor")
|
||||
if not b(1)==6:
|
||||
raise RuntimeError("functor")
|
||||
if not b(1, 2)==8:
|
||||
raise RuntimeError("functor")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue