Lines Matching refs:check
21 def check(text, expected):
29 # check text with no character references
30 check('no character references', 'no character references')
31 # check & followed by invalid chars
32 check('&\n&\t& &&', '&\n&\t& &&')
33 # check & followed by numbers and letters
34 check('&0 &9 &a &0; &9; &a;', '&0 &9 &a &0; &9; &a;')
35 # check incomplete entities at the end of the string
37 check(x, x)
38 check(x+';', x+';')
39 # check several combinations of numeric character references,
47 check(s % num, char)
49 check((s+end) % num, char+end)
50 # check invalid code points
53 # check more invalid code points
56 # check invalid numbers
59 # check small numbers
62 # check a big number
64 # check that multiple trailing semicolons are handled correctly
66 check(e, '";')
67 # check that semicolons in the middle don't create problems
69 check(e, '"quot;')
70 # check triple adjacent charrefs
72 check(e*3, '"""')
73 check((e+';')*3, '"""')
74 # check that the case is respected
76 check(e, '&')
78 check(e, e)
79 # check that non-existent named entities are returned unchanged
80 check('&svadilfari;', '&svadilfari;')
82 check('¬it', '¬it')
83 check('¬it;', '¬it;')
84 check('¬in', '¬in')
85 check('∉', '∉')
87 check('¬ReallyAnExistingNamedCharacterReference;',
90 check('∳', '∳')
91 # check a charref that maps to two unicode chars
92 check('∾̳', '\u223E\u0333')
93 check('&acE', '&acE')
95 check('{ ' * 1050, '{ ' * 1050)
97 check('ÉricÉric&alphacentauriαcentauri',
99 check('&co;', '&co;')