Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)