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

Method test_wlen

Lib/test/test_pyrepl/test_utils.py:35–48  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 self.assertEqual(str_width(c), 2)
34
35 def test_wlen(self):
36 for c in ['a', 'b', '1', '!', '_']:
37 self.assertEqual(wlen(c), 1)
38 self.assertEqual(wlen('\x1a'), 2)
39
40 char_east_asian_width_N = chr(3800)
41 self.assertEqual(wlen(char_east_asian_width_N), 1)
42 char_east_asian_width_W = chr(4352)
43 self.assertEqual(wlen(char_east_asian_width_W), 2)
44
45 self.assertEqual(wlen('hello'), 5)
46 self.assertEqual(wlen('hello' + '\x1a'), 7)
47 self.assertEqual(wlen('e\N{COMBINING ACUTE ACCENT}'), 1)
48 self.assertEqual(wlen('a\N{ZERO WIDTH JOINER}b'), 2)
49
50 def test_prev_next_window(self):
51 def gen_normal():

Callers

nothing calls this directly

Calls 2

wlenFunction · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected