Browse Source

New test on sub

Yann Weber 6 years ago
parent
commit
4915e15893
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      tests/test_cturmit.py

+ 7
- 1
tests/test_cturmit.py View File

@@ -124,7 +124,7 @@ class TurmitOperationTestCase(unittest.TestCase):
124 124
         ''' Test turmit sub() method '''
125 125
         self._rpn('sub')
126 126
 
127
-        t = Turmit()
127
+        t = Turmit(max_int=0xFFFF)
128 128
 
129 129
         t._push(50)
130 130
         t._push(8)
@@ -143,6 +143,12 @@ class TurmitOperationTestCase(unittest.TestCase):
143 143
         self.assertEqual(t._cur, 0)
144 144
         self.assertEqual(t.shead, 0)
145 145
 
146
+        t._push(8)
147
+        t._push(50)
148
+        t.sub()
149
+        self.assertEqual(t._cur, 1)
150
+        self.assertEqual(t.shead, 0xFFFF + (8 - 50))
151
+
146 152
     def test_mul(self):
147 153
         ''' Test turmit mul() method '''
148 154
         self._rpn('mul')

Loading…
Cancel
Save