def _test_equivalent_symbols(self): for left, right in self.equivalent_symbols: leftSurreal = shorthand(left) rightSurreal = shorthand(right) self.assertTrue(leftSurreal == rightSurreal, "%s should equal %s (Surreal: %s == %s)" % (left, right, leftSurreal, rightSurreal))
def test_not_well_formed_shorthands(self): for sh in self.not_well_formed: try: shorthand(sh) self.fail("%s should raise a BadlyFormed exception" % sh) except BadlyFormed: pass
def test_le_inequalities(self): for left, right in self.le_inequalities: self.assertTrue(shorthand(left) <= shorthand(right))
def test_well_formed_shorthands(self): for sh in self.well_formed: try: assert type(shorthand(sh)) == S except BadlyFormed: self.fail("%s should be well-formed" % sh)