Example #1
0
 def test_worksOnSingleLineString(self):
     src = trimLines('''
     foo bah
     ''')
     x,y = indexToCoordinates(src,src.index("bah"))
     self.assertEqual(x,4)
     self.assertEqual(y,0)
     x,y = indexToCoordinates(src,src.index("foo"))
     self.assertEqual(x,0)
     self.assertEqual(y,0)
Example #2
0
 def test_worksOnSingleLineString(self):
     src = trimLines('''
     foo bah
     ''')
     x, y = indexToCoordinates(src, src.index("bah"))
     self.assertEqual(x, 4)
     self.assertEqual(y, 0)
     x, y = indexToCoordinates(src, src.index("foo"))
     self.assertEqual(x, 0)
     self.assertEqual(y, 0)
Example #3
0
 def test_worksOnMultilLineString(self):
     src = trimLines('''
     foo bah
     baz boh
     ''')
     x,y = indexToCoordinates(src,src.index("boh"))
     self.assertEqual(x,4)
     self.assertEqual(y,1)
Example #4
0
 def test_worksOnMultilLineString(self):
     src = trimLines('''
     foo bah
     baz boh
     ''')
     x, y = indexToCoordinates(src, src.index("boh"))
     self.assertEqual(x, 4)
     self.assertEqual(y, 1)