Exemplo n.º 1
0
 def test_should_highlight_when_string_lengths_differ_again(self):
     text = highlight_differences("fo1234567890", "foo")
     self.assertEqual("fo${REVERSE}o${NORMAL}", text)
Exemplo n.º 2
0
 def test_should_highlight_everything_when_strings_mismatch_in_first_position_only(self):
     text = highlight_differences("foo", "boo")
     self.assertEqual("${REVERSE}boo${NORMAL}", text)
Exemplo n.º 3
0
 def test_should_highlight_every_but_the_first_character_when_strings_differ_in_position_two(self):
     text = highlight_differences("foo", "fXo")
     self.assertEqual("f${REVERSE}Xo${NORMAL}", text)
Exemplo n.º 4
0
 def test_should_highlight_everything_when_strings_mismatch_totally(self):
     text = highlight_differences("foo", "bar")
     self.assertEqual("${REVERSE}bar${NORMAL}", text)
Exemplo n.º 5
0
 def test_should_highlight_last_character_when_they_differ(self):
     text = highlight_differences("foo", "foX")
     self.assertEqual("fo${REVERSE}X${NORMAL}", text)
Exemplo n.º 6
0
 def test_should_highlight_nothing_when_no_difference(self):
     text = highlight_differences("foo", "foo")
     self.assertEqual("foo", text)
Exemplo n.º 7
0
 def test_should_highlight_when_text_longer_than_reference(self):
     text = highlight_differences("foo", "foo-123")
     self.assertEqual("foo${REVERSE}-123${NORMAL}", text)
 def test_should_highlight_when_text_longer_than_reference(self):
     text = highlight_differences("foo", "foo-123")
     self.assertEqual("foo${REVERSE}-123${NORMAL}", text)