def test_sustituir_tipo_base(self): s = Sustitucion() s.push(Var("a"), Fun(Var("b"), Int())) self.assertEqual(str(s.sustituir(Int())), str(Int())) self.assertEqual(str(s.sustituir(Bool())), str(Bool()))
def test_sustituir_paren(self): s = Sustitucion() s.push(Var("a"), Fun(Var("b"), Int())) self.assertEqual(str(s.sustituir(Paren(Var("a")))), str(Paren(Fun(Var("b"), Int()))))
def test_sustituir_vacio(self): s = Sustitucion() self.assertEqual(str(s.sustituir(Fun(Var("a"), Var("b")))), str(Fun(Var("a"), Var("b"))))