diff options
author | 2020-03-02 09:04:15 -0800 | |
---|---|---|
committer | 2020-03-02 09:04:15 -0800 | |
commit | 0be792ad0cadcaca951a3b506800dbeb406d9541 (patch) | |
tree | 40be154fa856461613053121e4db4cf16cbdaa77 /extra_tests | |
parent | Rewrote extra binop_overriding test to run -- removed all appdirect tests; on... (diff) | |
download | pypy-0be792ad0cadcaca951a3b506800dbeb406d9541.tar.gz pypy-0be792ad0cadcaca951a3b506800dbeb406d9541.tar.bz2 pypy-0be792ad0cadcaca951a3b506800dbeb406d9541.zip |
re-add deleted binop_overriding tests
Diffstat (limited to 'extra_tests')
-rw-r--r-- | extra_tests/test_binop_overriding.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/extra_tests/test_binop_overriding.py b/extra_tests/test_binop_overriding.py index a75d017a2d..5fcffafba4 100644 --- a/extra_tests/test_binop_overriding.py +++ b/extra_tests/test_binop_overriding.py @@ -76,6 +76,18 @@ def do_test(X, Y, name, impl): #print count[0] return fail +def test_binop_combinations_mul(): + class X(Base): + pass + class Y(X): + pass + + fail = do_test(X, Y, 'mul', lambda x,y: x*y) + #print len(fail) + assert not fail + + + def test_binop_combinations_sub(): class X(Base): pass @@ -85,3 +97,40 @@ def test_binop_combinations_sub(): fail = do_test(X, Y, 'sub', lambda x,y: x-y) #print len(fail) assert not fail + + +def test_binop_combinations_pow(): + class X(Base): + pass + class Y(X): + pass + + fail = do_test(X, Y, 'pow', lambda x,y: x**y) + #print len(fail) + assert not fail + +def test_binop_combinations_more_exhaustive(): + class X(Base): + pass + + class B1(object): + pass + + class B2(object): + pass + + class X1(B1, X, B2): + pass + + class C1(object): + pass + + class C2(object): + pass + + class Y(C1, X1, C2): + pass + + fail = do_test(X, Y, 'sub', lambda x,y: x-y) + #print len(fail) + assert not fail |