Lines Matching refs:check

256         def check(expr, expected):  function
265 check('', '0')
266 check('8.2 + 6', '14.2')
267 check('3.1 + $a', '6.1')
268 check('2 + "$a.$b"', '5.6')
269 check('4*[llength "6 2"]', '8')
270 check('{word one} < "word $a"', '0')
271 check('4*2 < 7', '0')
272 check('hypot($a, 4)', '5.0')
273 check('5 / 4', '1')
274 check('5 / 4.0', '1.25')
275 check('5 / ( [string length "abcd"] + 0.0 )', '1.25')
276 check('20.0/5.0', '4.0')
277 check('"0x03" > "2"', '1')
278 check('[string length "a\xbd\u20ac"]', '3')
279 check(r'[string length "a\xbd\u20ac"]', '3')
280 check('"abc"', 'abc')
281 check('"a\xbd\u20ac"', 'a\xbd\u20ac')
282 check(r'"a\xbd\u20ac"', 'a\xbd\u20ac')
283 check(r'"a\0b"', 'a\x00b')
285 check('2**64', str(2**64))
291 def check(expr, expected): function
300 check('', 0.0)
301 check('8.2 + 6', 14.2)
302 check('3.1 + $a', 6.1)
303 check('2 + "$a.$b"', 5.6)
304 check('4*[llength "6 2"]', 8.0)
305 check('{word one} < "word $a"', 0.0)
306 check('4*2 < 7', 0.0)
307 check('hypot($a, 4)', 5.0)
308 check('5 / 4', 1.0)
309 check('5 / 4.0', 1.25)
310 check('5 / ( [string length "abcd"] + 0.0 )', 1.25)
311 check('20.0/5.0', 4.0)
312 check('"0x03" > "2"', 1.0)
313 check('[string length "a\xbd\u20ac"]', 3.0)
314 check(r'[string length "a\xbd\u20ac"]', 3.0)
317 check('2**64', float(2**64))
323 def check(expr, expected): function
332 check('', 0)
333 check('8.2 + 6', 14)
334 check('3.1 + $a', 6)
335 check('2 + "$a.$b"', 5)
336 check('4*[llength "6 2"]', 8)
337 check('{word one} < "word $a"', 0)
338 check('4*2 < 7', 0)
339 check('hypot($a, 4)', 5)
340 check('5 / 4', 1)
341 check('5 / 4.0', 1)
342 check('5 / ( [string length "abcd"] + 0.0 )', 1)
343 check('20.0/5.0', 4)
344 check('"0x03" > "2"', 1)
345 check('[string length "a\xbd\u20ac"]', 3)
346 check(r'[string length "a\xbd\u20ac"]', 3)
355 def check(expr, expected): function
365 check('', False)
367 check(value, False)
368 check('"%s"' % value, False)
369 check('{%s}' % value, False)
371 check(value, True)
372 check('"%s"' % value, True)
373 check('{%s}' % value, True)
374 check('8.2 + 6', True)
375 check('3.1 + $a', True)
376 check('2 + "$a.$b"', True)
377 check('4*[llength "6 2"]', True)
378 check('{word one} < "word $a"', False)
379 check('4*2 < 7', False)
380 check('hypot($a, 4)', True)
381 check('5 / 4', True)
382 check('5 / 4.0', True)
383 check('5 / ( [string length "abcd"] + 0.0 )', True)
384 check('20.0/5.0', True)
385 check('"0x03" > "2"', True)
386 check('[string length "a\xbd\u20ac"]', True)
387 check(r'[string length "a\xbd\u20ac"]', True)
390 check('2**64', True)
395 def check(expr, expected): function
403 check('true', True)
404 check('yes', True)
405 check('on', True)
406 check('false', False)
407 check('no', False)
408 check('off', False)
409 check('1 < 2', True)
410 check('1 > 2', False)
478 def check(value, expected=None, *, eq=self.assertEqual): function
492 check(True, '1')
493 check(False, '0')
494 check('string')
495 check('string\xbd')
496 check('string\u20ac')
497 check('string\U0001f4bb')
498 check('')
499 check(b'string', 'string')
500 check(b'string\xe2\x82\xac', 'string\xe2\x82\xac')
501 check(b'string\xbd', 'string\xbd')
502 check(b'', '')
503 check('str\x00ing')
504 check('str\x00ing\xbd')
505 check('str\x00ing\u20ac')
506 check(b'str\x00ing', 'str\x00ing')
507 check(b'str\xc0\x80ing', 'str\xc0\x80ing')
508 check(b'str\xc0\x80ing\xe2\x82\xac', 'str\xc0\x80ing\xe2\x82\xac')
510 check(i, str(i))
512 check(2**1000, str(2**1000))
514 check(f, repr(f))
517 check(f, eq=float_eq)
518 check(float('inf'), eq=float_eq)
519 check(-float('inf'), eq=float_eq)
521 check((), '')
522 check((1, (2,), (3, 4), '5 6', ()), '1 2 {3 4} {5 6} {}')
523 check([1, [2,], [3, 4], '5 6', []], '1 2 {3 4} {5 6} {}')
667 def check(value): function
674 check('')
675 check('spam')
676 check('sp am')
677 check('sp\tam')
678 check('sp\nam')
679 check(' \t\n')
680 check('{spam}')
681 check('{sp am}')
682 check('"spam"')
683 check('"sp am"')
684 check('{"spam"}')
685 check('"{spam}"')
686 check('sp\\am')
687 check('"sp\\am"')
688 check('"{}" "{}"')
689 check('"\\')
690 check('"{')
691 check('"}')
692 check('\n\\')
693 check('\n{')
694 check('\n}')
695 check('\\\n')
696 check('{\n')
697 check('}\n')