Anonymous avatar 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'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.