Lines Matching full:eval
22 exec()/eval(), which uses a different code path.
82 self.assertEqual(eval(""" 'x' """), 'x')
83 self.assertEqual(eval(r""" '\x01' """), chr(1))
84 self.assertEqual(eval(""" '\x01' """), chr(1))
85 self.assertEqual(eval(r""" '\x81' """), chr(0x81))
86 self.assertEqual(eval(""" '\x81' """), chr(0x81))
87 self.assertEqual(eval(r""" '\u1881' """), chr(0x1881))
88 self.assertEqual(eval(""" '\u1881' """), chr(0x1881))
89 self.assertEqual(eval(r""" '\U0001d120' """), chr(0x1d120))
90 self.assertEqual(eval(""" '\U0001d120' """), chr(0x1d120))
93 self.assertRaises(SyntaxError, eval, r""" '\x' """)
94 self.assertRaises(SyntaxError, eval, r""" '\x0' """)
95 self.assertRaises(SyntaxError, eval, r""" '\u' """)
96 self.assertRaises(SyntaxError, eval, r""" '\u0' """)
97 self.assertRaises(SyntaxError, eval, r""" '\u00' """)
98 self.assertRaises(SyntaxError, eval, r""" '\u000' """)
99 self.assertRaises(SyntaxError, eval, r""" '\U' """)
100 self.assertRaises(SyntaxError, eval, r""" '\U0' """)
101 self.assertRaises(SyntaxError, eval, r""" '\U00' """)
102 self.assertRaises(SyntaxError, eval, r""" '\U000' """)
103 self.assertRaises(SyntaxError, eval, r""" '\U0000' """)
104 self.assertRaises(SyntaxError, eval, r""" '\U00000' """)
105 self.assertRaises(SyntaxError, eval, r""" '\U000000' """)
106 self.assertRaises(SyntaxError, eval, r""" '\U0000000' """)
113 self.assertEqual(eval(r"'\%c'" % b), '\\' + chr(b))
117 eval("'''\n\\z'''")
125 eval("'''\n\\z'''")
132 self.assertEqual(eval(""" r'x' """), 'x')
133 self.assertEqual(eval(r""" r'\x01' """), '\\' + 'x01')
134 self.assertEqual(eval(""" r'\x01' """), chr(1))
135 self.assertEqual(eval(r""" r'\x81' """), '\\' + 'x81')
136 self.assertEqual(eval(""" r'\x81' """), chr(0x81))
137 self.assertEqual(eval(r""" r'\u1881' """), '\\' + 'u1881')
138 self.assertEqual(eval(""" r'\u1881' """), chr(0x1881))
139 self.assertEqual(eval(r""" r'\U0001d120' """), '\\' + 'U0001d120')
140 self.assertEqual(eval(""" r'\U0001d120' """), chr(0x1d120))
143 self.assertEqual(eval(""" b'x' """), b'x')
144 self.assertEqual(eval(r""" b'\x01' """), byte(1))
145 self.assertEqual(eval(""" b'\x01' """), byte(1))
146 self.assertEqual(eval(r""" b'\x81' """), byte(0x81))
147 self.assertRaises(SyntaxError, eval, """ b'\x81' """)
148 self.assertEqual(eval(r""" br'\u1881' """), b'\\' + b'u1881')
149 self.assertRaises(SyntaxError, eval, """ b'\u1881' """)
150 self.assertEqual(eval(r""" br'\U0001d120' """), b'\\' + b'U0001d120')
151 self.assertRaises(SyntaxError, eval, """ b'\U0001d120' """)
154 self.assertRaises(SyntaxError, eval, r""" b'\x' """)
155 self.assertRaises(SyntaxError, eval, r""" b'\x0' """)
162 self.assertEqual(eval(r"b'\%c'" % b), b'\\' + bytes([b]))
166 eval("b'''\n\\z'''")
174 eval("b'''\n\\z'''")
181 self.assertEqual(eval(""" br'x' """), b'x')
182 self.assertEqual(eval(""" rb'x' """), b'x')
183 self.assertEqual(eval(r""" br'\x01' """), b'\\' + b'x01')
184 self.assertEqual(eval(r""" rb'\x01' """), b'\\' + b'x01')
185 self.assertEqual(eval(""" br'\x01' """), byte(1))
186 self.assertEqual(eval(""" rb'\x01' """), byte(1))
187 self.assertEqual(eval(r""" br'\x81' """), b"\\" + b"x81")
188 self.assertEqual(eval(r""" rb'\x81' """), b"\\" + b"x81")
189 self.assertRaises(SyntaxError, eval, """ br'\x81' """)
190 self.assertRaises(SyntaxError, eval, """ rb'\x81' """)
191 self.assertEqual(eval(r""" br'\u1881' """), b"\\" + b"u1881")
192 self.assertEqual(eval(r""" rb'\u1881' """), b"\\" + b"u1881")
193 self.assertRaises(SyntaxError, eval, """ br'\u1881' """)
194 self.assertRaises(SyntaxError, eval, """ rb'\u1881' """)
195 self.assertEqual(eval(r""" br'\U0001d120' """), b"\\" + b"U0001d120")
196 self.assertEqual(eval(r""" rb'\U0001d120' """), b"\\" + b"U0001d120")
197 self.assertRaises(SyntaxError, eval, """ br'\U0001d120' """)
198 self.assertRaises(SyntaxError, eval, """ rb'\U0001d120' """)
199 self.assertRaises(SyntaxError, eval, """ bb'' """)
200 self.assertRaises(SyntaxError, eval, """ rr'' """)
201 self.assertRaises(SyntaxError, eval, """ brr'' """)
202 self.assertRaises(SyntaxError, eval, """ bbr'' """)
203 self.assertRaises(SyntaxError, eval, """ rrb'' """)
204 self.assertRaises(SyntaxError, eval, """ rbb'' """)
207 self.assertEqual(eval(""" u'x' """), 'x')
208 self.assertEqual(eval(""" U'\u00e4' """), 'ä')
209 self.assertEqual(eval(""" u'\N{LATIN SMALL LETTER A WITH DIAERESIS}' """), 'ä')
210 self.assertRaises(SyntaxError, eval, """ ur'' """)
211 self.assertRaises(SyntaxError, eval, """ ru'' """)
212 self.assertRaises(SyntaxError, eval, """ bu'' """)
213 self.assertRaises(SyntaxError, eval, """ ub'' """)