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"})
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"})
def test_dont_find_word3_and_dont_hang (self): self.assertEqual(expand_region_handler.expand_to_word("aaa", 0, 3), None)
def test_dont_find_word2 (self): self.assertEqual(expand_region_handler.expand_to_word(" ee ee ", 2, 5), None)
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"})
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")
def test_dont_find_word (self): self.assertEqual(expand_region_handler.expand_to_word(self.string1, 1, 10), None)
def test_dont_find_word3_and_dont_hang (self): result = expand_region_handler.expand_to_word("aaa", 0, 3); self.assertEqual(result, None)
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")
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")
def test_dont_find_word2 (self): result = expand_region_handler.expand_to_word(" ee ee", 2, 5); self.assertEqual(result, None)
def test_dont_find_word (self): result = expand_region_handler.expand_to_word(self.string1, 1, 10); self.assertEqual(result, None)