Lines Matching refs:check
280 def check(expr, expected): function
288 check('', '0')
289 check('8.2 + 6', '14.2')
290 check('3.1 + $a', '6.1')
291 check('2 + "$a.$b"', '5.6')
292 check('4*[llength "6 2"]', '8')
293 check('{word one} < "word $a"', '0')
294 check('4*2 < 7', '0')
295 check('hypot($a, 4)', '5.0')
296 check('5 / 4', '1')
297 check('5 / 4.0', '1.25')
298 check('5 / ( [string length "abcd"] + 0.0 )', '1.25')
299 check('20.0/5.0', '4.0')
300 check('"0x03" > "2"', '1')
301 check('[string length "a\xc2\xbd\xe2\x82\xac"]', '3')
302 check(r'[string length "a\xbd\u20ac"]', '3')
303 check('"abc"', 'abc')
304 check('"a\xc2\xbd\xe2\x82\xac"', 'a\xc2\xbd\xe2\x82\xac')
305 check(r'"a\xbd\u20ac"', 'a\xc2\xbd\xe2\x82\xac')
306 check(r'"a\0b"', 'a\xc0\x80b')
308 check('2**64', str(2**64))
314 def check(expr, expected): function
322 check('', 0.0)
323 check('8.2 + 6', 14.2)
324 check('3.1 + $a', 6.1)
325 check('2 + "$a.$b"', 5.6)
326 check('4*[llength "6 2"]', 8.0)
327 check('{word one} < "word $a"', 0.0)
328 check('4*2 < 7', 0.0)
329 check('hypot($a, 4)', 5.0)
330 check('5 / 4', 1.0)
331 check('5 / 4.0', 1.25)
332 check('5 / ( [string length "abcd"] + 0.0 )', 1.25)
333 check('20.0/5.0', 4.0)
334 check('"0x03" > "2"', 1.0)
335 check('[string length "a\xc2\xbd\xe2\x82\xac"]', 3.0)
336 check(r'[string length "a\xbd\u20ac"]', 3.0)
339 check('2**64', float(2**64))
345 def check(expr, expected): function
353 check('', 0)
354 check('8.2 + 6', 14)
355 check('3.1 + $a', 6)
356 check('2 + "$a.$b"', 5)
357 check('4*[llength "6 2"]', 8)
358 check('{word one} < "word $a"', 0)
359 check('4*2 < 7', 0)
360 check('hypot($a, 4)', 5)
361 check('5 / 4', 1)
362 check('5 / 4.0', 1)
363 check('5 / ( [string length "abcd"] + 0.0 )', 1)
364 check('20.0/5.0', 4)
365 check('"0x03" > "2"', 1)
366 check('[string length "a\xc2\xbd\xe2\x82\xac"]', 3)
367 check(r'[string length "a\xbd\u20ac"]', 3)
376 def check(expr, expected): function
385 check('', False)
387 check(value, False)
388 check('"%s"' % value, False)
389 check('{%s}' % value, False)
391 check(value, True)
392 check('"%s"' % value, True)
393 check('{%s}' % value, True)
394 check('8.2 + 6', True)
395 check('3.1 + $a', True)
396 check('2 + "$a.$b"', True)
397 check('4*[llength "6 2"]', True)
398 check('{word one} < "word $a"', False)
399 check('4*2 < 7', False)
400 check('hypot($a, 4)', True)
401 check('5 / 4', True)
402 check('5 / 4.0', True)
403 check('5 / ( [string length "abcd"] + 0.0 )', True)
404 check('20.0/5.0', True)
405 check('"0x03" > "2"', True)
406 check('[string length "a\xc2\xbd\xe2\x82\xac"]', True)
407 check(r'[string length "a\xbd\u20ac"]', True)
410 check('2**64', True)
415 def check(expr, expected): function
423 check('true', True)
424 check('yes', True)
425 check('on', True)
426 check('false', False)
427 check('no', False)
428 check('off', False)
429 check('1 < 2', True)
430 check('1 > 2', False)
494 def check(value, expected=None, eq=self.assertEqual): function
508 check(True, '1')
509 check(False, '0')
510 check('string')
511 check('string\xbd')
512 check('string\xe2\x82\xac', u'string\u20ac')
513 check('')
514 check(u'string')
515 check(u'string\xbd')
516 check(u'string\u20ac')
517 check(u'')
518 check('str\xc0\x80ing', u'str\x00ing')
519 check('str\xc0\x80ing\xe2\x82\xac', u'str\x00ing\u20ac')
520 check(u'str\x00ing')
521 check(u'str\x00ing\xbd')
522 check(u'str\x00ing\u20ac')
524 check(i, str(i))
526 check(2**1000, str(2**1000))
528 check(f, repr(f))
531 check(f, eq=float_eq)
532 check(float('inf'), eq=float_eq)
533 check(-float('inf'), eq=float_eq)
535 check((), '')
536 check((1, (2,), (3, 4), '5 6', ()), '1 2 {3 4} {5 6} {}')
669 def check(value): function
676 check('')
677 check('spam')
678 check('sp am')
679 check('sp\tam')
680 check('sp\nam')
681 check(' \t\n')
682 check('{spam}')
683 check('{sp am}')
684 check('"spam"')
685 check('"sp am"')
686 check('{"spam"}')
687 check('"{spam}"')
688 check('sp\\am')
689 check('"sp\\am"')
690 check('"{}" "{}"')
691 check('"\\')
692 check('"{')
693 check('"}')
694 check('\n\\')
695 check('\n{')
696 check('\n}')
697 check('\\\n')
698 check('{\n')
699 check('}\n')