예제 #1
0
 def test_word_with_whitespaces_around (self):
   self.assertEqual(expand_region_handler.expand_to_word(" hello ", 3, 3), {"start": 1, "end": 6, "string": "hello", "type": "word"})
예제 #2
0
 def test_dont_find_word3 (self):
   self.assertEqual(expand_region_handler.expand_to_word("foo.bar", 5, 5), {"start": 4, "end": 7, "string": "bar", "type": "word"})
예제 #3
0
 def test_dont_find_word3_and_dont_hang (self):
   self.assertEqual(expand_region_handler.expand_to_word("aaa", 0, 3), None)
예제 #4
0
 def test_dont_find_word2 (self):
   self.assertEqual(expand_region_handler.expand_to_word(" ee ee ", 2, 5), None)
예제 #5
0
 def test_string_is_only_word (self):
   self.assertEqual(expand_region_handler.expand_to_word("bar", 1, 1), {"start": 0, "end": 3, "string": "bar", "type": "word"})
예제 #6
0
 def test_word_with_whitespaces_around (self):
   result = expand_region_handler.expand_to_word(" hello ", 3, 3);
   self.assertEqual(result["start"], 1)
   self.assertEqual(result["end"], 6)
   self.assertEqual(result["string"], "hello")
예제 #7
0
 def test_dont_find_word (self):
   self.assertEqual(expand_region_handler.expand_to_word(self.string1, 1, 10), None)
예제 #8
0
 def test_dont_find_word3_and_dont_hang (self):
   result = expand_region_handler.expand_to_word("aaa", 0, 3);
   self.assertEqual(result, None)
예제 #9
0
 def test_dont_find_word3 (self):
   result = expand_region_handler.expand_to_word("foo.bar", 5, 5);
   self.assertEqual(result["start"], 4)
   self.assertEqual(result["end"], 7)
   self.assertEqual(result["string"], "bar")
예제 #10
0
 def test_string_is_only_word (self):
   result = expand_region_handler.expand_to_word("bar", 1, 1);
   self.assertEqual(result["start"], 0)
   self.assertEqual(result["end"], 3)
   self.assertEqual(result["string"], "bar")
예제 #11
0
 def test_dont_find_word2 (self):
   result = expand_region_handler.expand_to_word(" ee ee", 2, 5);
   self.assertEqual(result, None)
예제 #12
0
 def test_dont_find_word (self):
   result = expand_region_handler.expand_to_word(self.string1, 1, 10);
   self.assertEqual(result, None)