def test_add_assignment(self): vars = Variables([x]) vars += y self.assertEqual(vars.size(), 2) vars += Variables([x, z]) self.assertEqual(vars.size(), 3)
def test_erase2(self): vars1 = Variables([x, y, z]) vars2 = Variables([w, z]) count = vars1.erase(vars2) self.assertEqual(count, 1) self.assertEqual(vars1.size(), 2)
def test_insert2(self): vars = Variables([x]) vars.insert(Variables([y, z])) self.assertEqual(vars.size(), 3)
def test_insert1(self): vars = Variables() vars.insert(x) self.assertEqual(vars.size(), 1)
def test_constructor_list(self): vars = Variables([x, y, z]) self.assertEqual(vars.size(), 3) self.assertEqual(len(vars), 3)
def test_default_constructor(self): vars = Variables() self.assertEqual(vars.size(), 0) self.assertTrue(vars.empty())