Author: Ronan Lamy <ronan.l...@gmail.com> Branch: anntype2 Changeset: r81002:c097d2bd6fdf Date: 2015-11-27 13:57 +0000 http://bitbucket.org/pypy/pypy/changeset/c097d2bd6fdf/
Log: Add more tests diff --git a/rpython/annotator/test/test_model.py b/rpython/annotator/test/test_model.py --- a/rpython/annotator/test/test_model.py +++ b/rpython/annotator/test/test_model.py @@ -196,3 +196,21 @@ s_value2, s_exc2 = annotate_op(annotator, hlop, [s_empty_list, s_int]) assert contains_s(s_value2, s_value) assert contains_s(s_exc2, s_exc) + +def test_generalize_getitem_string(annotator): + hlop = op.getitem(Variable(), Variable()) + s_int = SomeInteger() + s_str = SomeString(can_be_None=True) + s_value, s_exc = annotate_op(annotator, hlop, [s_None, s_int]) + s_value2, s_exc2 = annotate_op(annotator, hlop, [s_str, s_int]) + assert contains_s(s_value2, s_value) + assert contains_s(s_exc2, s_exc) + +def test_generalize_string_concat(annotator): + hlop = op.add(Variable(), Variable()) + s_str = SomeString(can_be_None=True) + s_value, s_exc = annotate_op(annotator, hlop, [s_None, s_str]) + s_value2, s_exc2 = annotate_op(annotator, hlop, [s_str, s_str]) + assert contains_s(s_value2, s_value) + assert contains_s(s_exc2, s_exc) + _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit