コード例 #1
0
 def test_empty_span(self):
     self.assertEqual((4, 7),
                      formatting.line_expanded_span('012\n456\n890\n', 5,
                                                    4))
     self.assertEqual((4, 7),
                      formatting.line_expanded_span('012\n456\n890\n', 5,
                                                    5))
コード例 #2
0
 def test_line_overlap_span(self):
     self.assertEqual((0, 11),
                      formatting.line_expanded_span('012\n456\n890\n', 3,
                                                    9))
コード例 #3
0
 def test_noop(self):
     self.assertEqual((4, 7),
                      formatting.line_expanded_span('012\n456\n890\n', 4,
                                                    7))
コード例 #4
0
 def test_line_end(self):
     self.assertEqual((4, 11),
                      formatting.line_expanded_span('012\n456\n890\n', 7,
                                                    8))
コード例 #5
0
 def test_line_start_2(self):
     self.assertEqual((4, 7),
                      formatting.line_expanded_span('012\n456\n890\n', 4,
                                                    4))
コード例 #6
0
 def test_string_end(self):
     self.assertEqual((8, 11),
                      formatting.line_expanded_span('012\n456\n890\n', 9,
                                                    10))
コード例 #7
0
 def test_string_start(self):
     self.assertEqual((0, 3),
                      formatting.line_expanded_span('012\n456\n890\n', 1,
                                                    2))
コード例 #8
0
 def test_line_subset_(self):
     self.assertEqual((4, 7),
                      formatting.line_expanded_span('012\n456\n890\n', 5,
                                                    6))
コード例 #9
0
 def test_negative(self):
     self.assertEqual((8, 11),
                      formatting.line_expanded_span('012\n456\n890\n', -2,
                                                    -1))
コード例 #10
0
 def test_none(self):
     self.assertEqual((0, 12),
                      formatting.line_expanded_span('012\n456\n890\n', None,
                                                    None))