MCPcopy Index your code
hub / github.com/python/cpython / test_insert

Method test_insert

Lib/idlelib/idle_test/test_text.py:64–88  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

62 Equal(get('0.0', '5.0'), self.hwn)
63
64 def test_insert(self):
65 insert = self.text.insert
66 get = self.text.get
67 Equal = self.assertEqual
68
69 insert('1.0', self.hw)
70 Equal(get('1.0', 'end'), self.hwn)
71
72 insert('1.0', '') # nothing
73 Equal(get('1.0', 'end'), self.hwn)
74
75 insert('1.0', '*')
76 Equal(get('1.0', 'end'), '*hello\nworld\n')
77
78 insert('1.0 lineend', '*')
79 Equal(get('1.0', 'end'), '*hello*\nworld\n')
80
81 insert('2.3', '*')
82 Equal(get('1.0', 'end'), '*hello*\nwor*ld\n')
83
84 insert('end', 'x')
85 Equal(get('1.0', 'end'), '*hello*\nwor*ldx\n')
86
87 insert('1.4', 'x\n')
88 Equal(get('1.0', 'end'), '*helx\nlo*\nwor*ldx\n')
89
90 def test_no_delete(self):
91 # if index1 == 'insert' or 'end' or >= end, there is no deletion

Callers

nothing calls this directly

Calls 2

insertFunction · 0.85
getFunction · 0.50

Tested by

no test coverage detected