Support for dummy symbols
[linpy.git] / pypol / tests / test_linexprs.py
index adfec7d..508c57b 100644 (file)
@@ -231,6 +231,23 @@ class TestSymbol(unittest.TestCase):
         self.assertListEqual(list(symbols(['x', 'y'])), [self.x, self.y])
 
 
         self.assertListEqual(list(symbols(['x', 'y'])), [self.x, self.y])
 
 
+class TestDummy(unittest.TestCase):
+
+    def setUp(self):
+        self.x = Dummy('x')
+
+    def test_new(self):
+        self.assertEqual(self.x.name, 'x')
+        self.assertTrue(Dummy().name.startswith('Dummy'))
+
+    def test_eq(self):
+        self.assertEqual(self.x, self.x)
+        self.assertNotEqual(self.x, Symbol('x'))
+        self.assertNotEqual(Symbol('x'), self.x)
+        self.assertNotEqual(self.x, Dummy('x'))
+        self.assertNotEqual(Dummy(), Dummy())
+
+
 class TestRational(unittest.TestCase):
 
     def setUp(self):
 class TestRational(unittest.TestCase):
 
     def setUp(self):