Commits

Anonymous committed 73c6008

worder: is assigned here and != test

Comments (0)

Files changed (2)

rope/base/worder.py

         single = self.code[next_char:next_char + 1]
         double = self.code[next_char:next_char + 2]
         triple = self.code[next_char:next_char + 3]
-        if double not in ('==', '<=', '>='):
+        if double not in ('==', '<=', '>=', '!='):
             for op in [single, double, triple]:
                 if op.endswith('='):
                     return op

ropetest/codeanalyzetest.py

         word_finder = worder.Worder(code)
         self.assertFalse(word_finder.is_assigned_here(0))
 
+    def test_is_assigned_here_for_not_equal_test(self):
+        code = 'a != 1\n'
+        word_finder = worder.Worder(code)
+        self.assertFalse(word_finder.is_assigned_here(0))
+
     # XXX: is_assigned_here should work for tuple assignments
     def xxx_test_is_assigned_here_for_tuple_assignment(self):
         code = 'a, b = (1, 2)\n'