Lines Matching full:assertequal
132 self.assertEqual(complex.__eq__(1+1j, 1L<<10000), False)
133 self.assertEqual(complex.__lt__(1+1j, None), NotImplemented)
183 self.assertEqual(a ** 0j, 1)
184 self.assertEqual(a ** 0.+0.j, 1)
186 self.assertEqual(3j ** 0j, 1)
187 self.assertEqual(3j ** 0, 1)
204 self.assertEqual(a ** 105, a ** 105)
205 self.assertEqual(a ** -105, a ** -105)
206 self.assertEqual(a ** -30, a ** -30)
208 self.assertEqual(0.0j ** 0, 1)
228 self.assertEqual(complex(OS(1+10j)), 1+10j)
229 self.assertEqual(complex(NS(1+10j)), 1+10j)
292 self.assertEqual(split_zeros(complex(1., 0.).imag), split_zeros(0.))
293 self.assertEqual(split_zeros(complex(1., -0.).imag), split_zeros(-0.))
294 self.assertEqual(split_zeros(complex(0., 1.).real), split_zeros(0.))
295 self.assertEqual(split_zeros(complex(-0., 1.).real), split_zeros(-0.))
305 self.assertEqual(complex(unicode(" 3.14+J ")), 3.14+1j)
341 self.assertEqual(type(complex(unicode("1"*500))), complex)
441 self.assertEqual(hash(x), hash(complex(x, 0)))
443 self.assertEqual(hash(x), hash(complex(x, 0.)))
451 self.assertEqual(repr(1+6j), '(1+6j)')
452 self.assertEqual(repr(1-6j), '(1-6j)')
456 self.assertEqual(1-6j,complex(repr(1-6j)))
457 self.assertEqual(1+6j,complex(repr(1+6j)))
458 self.assertEqual(-6j,complex(repr(-6j)))
459 self.assertEqual(6j,complex(repr(6j)))
461 self.assertEqual(repr(complex(1., INF)), "(1+infj)")
462 self.assertEqual(repr(complex(1., -INF)), "(1-infj)")
463 self.assertEqual(repr(complex(INF, 1)), "(inf+1j)")
464 self.assertEqual(repr(complex(-INF, INF)), "(-inf+infj)")
465 self.assertEqual(repr(complex(NAN, 1)), "(nan+1j)")
466 self.assertEqual(repr(complex(1, NAN)), "(1+nanj)")
467 self.assertEqual(repr(complex(NAN, NAN)), "(nan+nanj)")
469 self.assertEqual(repr(complex(0, INF)), "infj")
470 self.assertEqual(repr(complex(0, -INF)), "-infj")
471 self.assertEqual(repr(complex(0, NAN)), "nanj")
474 self.assertEqual(-(1+6j), -1-6j)
486 self.assertEqual(fo.read(), "%s %s\n" % (a, b))
493 self.assertEqual((1+2j).__getnewargs__(), (1.0, 2.0))
494 self.assertEqual((1-2j).__getnewargs__(), (1.0, -2.0))
495 self.assertEqual((2j).__getnewargs__(), (0.0, 2.0))
496 self.assertEqual((-0j).__getnewargs__(), (0.0, -0.0))
497 self.assertEqual(complex(0, INF).__getnewargs__(), (0.0, INF))
498 self.assertEqual(complex(INF, 0).__getnewargs__(), (INF, 0.0))
504 self.assertEqual(atan2(z1.imag, -1.), atan2(0., -1.))
505 self.assertEqual(atan2(z2.imag, -1.), atan2(-0., -1.))
510 self.assertEqual(complex("1e500"), complex(INF, 0.0))
511 self.assertEqual(complex("-1e500j"), complex(0.0, -INF))
512 self.assertEqual(complex("-1e500+1.8e308j"), complex(-INF, INF))
545 self.assertEqual(format(1+3j, ''), str(1+3j))
546 self.assertEqual(format(1.5+3.5j, ''), str(1.5+3.5j))
547 self.assertEqual(format(3j, ''), str(3j))
548 self.assertEqual(format(3.2j, ''), str(3.2j))
549 self.assertEqual(format(3+0j, ''), str(3+0j))
550 self.assertEqual(format(3.2+0j, ''), str(3.2+0j))
554 self.assertEqual(format(3.2+0j, '-'), str(3.2+0j))
555 self.assertEqual(format(3.2+0j, '<'), str(3.2+0j))
557 self.assertEqual(format(z, ''), str(z))
558 self.assertEqual(format(z, '-'), str(z))
559 self.assertEqual(format(z, '<'), str(z))
560 self.assertEqual(format(z, '10'), str(z))
562 self.assertEqual(format(z, ''), str(z))
563 self.assertEqual(format(z, '-'), str(z))
564 self.assertEqual(format(z, '<'), str(z))
565 self.assertEqual(format(z, '2'), str(z))
567 self.assertEqual(format(z, ''), str(z))
568 self.assertEqual(format(z, '-'), str(z))
569 self.assertEqual(format(z, '<'), str(z))
570 self.assertEqual(format(z, '3'), str(z))
572 self.assertEqual(format(1+3j, 'g'), '1+3j')
573 self.assertEqual(format(3j, 'g'), '0+3j')
574 self.assertEqual(format(1.5+3.5j, 'g'), '1.5+3.5j')
576 self.assertEqual(format(1.5+3.5j, '+g'), '+1.5+3.5j')
577 self.assertEqual(format(1.5-3.5j, '+g'), '+1.5-3.5j')
578 self.assertEqual(format(1.5-3.5j, '-g'), '1.5-3.5j')
579 self.assertEqual(format(1.5+3.5j, ' g'), ' 1.5+3.5j')
580 self.assertEqual(format(1.5-3.5j, ' g'), ' 1.5-3.5j')
581 self.assertEqual(format(-1.5+3.5j, ' g'), '-1.5+3.5j')
582 self.assertEqual(format(-1.5-3.5j, ' g'), '-1.5-3.5j')
584 self.assertEqual(format(-1.5-3.5e-20j, 'g'), '-1.5-3.5e-20j')
585 self.assertEqual(format(-1.5-3.5j, 'f'), '-1.500000-3.500000j')
586 self.assertEqual(format(-1.5-3.5j, 'F'), '-1.500000-3.500000j')
587 self.assertEqual(format(-1.5-3.5j, 'e'), '-1.500000e+00-3.500000e+00j')
588 self.assertEqual(format(-1.5-3.5j, '.2e'), '-1.50e+00-3.50e+00j')
589 self.assertEqual(format(-1.5-3.5j, '.2E'), '-1.50E+00-3.50E+00j')
590 self.assertEqual(format(-1.5e10-3.5e5j, '.2G'), '-1.5E+10-3.5E+05j')
592 self.assertEqual(format(1.5+3j, '<20g'), '1.5+3j ')
593 self.assertEqual(format(1.5+3j, '*<20g'), '1.5+3j**************')
594 self.assertEqual(format(1.5+3j, '>20g'), ' 1.5+3j')
595 self.assertEqual(format(1.5+3j, '^20g'), ' 1.5+3j ')
596 self.assertEqual(format(1.5+3j, '<20'), '(1.5+3j) ')
597 self.assertEqual(format(1.5+3j, '>20'), ' (1.5+3j)')
598 self.assertEqual(format(1.5+3j, '^20'), ' (1.5+3j) ')
599 self.assertEqual(format(1.123-3.123j, '^20.2'), ' (1.1-3.1j) ')
601 self.assertEqual(format(1.5+3j, '20.2f'), ' 1.50+3.00j')
602 self.assertEqual(format(1.5+3j, '>20.2f'), ' 1.50+3.00j')
603 self.assertEqual(format(1.5+3j, '<20.2f'), '1.50+3.00j ')
604 self.assertEqual(format(1.5e20+3j, '<20.2f'), '150000000000000000000.00+3.00j')
605 self.assertEqual(format(1.5e20+3j, '>40.2f'), ' 150000000000000000000.00+3.00j')
606 self.assertEqual(format(1.5e20+3j, '^40,.2f'), ' 150,000,000,000,000,000,000.00+3.00j ')
607 self.assertEqual(format(1.5e21+3j, '^40,.2f'), ' 1,500,000,000,000,000,000,000.00+3.00j ')
608 self.assertEqual(format(1.5e21+3000j, ',.2f'), '1,500,000,000,000,000,000,000.00+3,000.00j')
624 self.assertEqual('*{0:.3f}*'.format(3.14159+2.71828j), '*3.142+2.718j*')
627 self.assertEqual('{0:f}'.format(INF+0j), 'inf+0.000000j')
628 self.assertEqual('{0:F}'.format(INF+0j), 'INF+0.000000j')
629 self.assertEqual('{0:f}'.format(-INF+0j), '-inf+0.000000j')
630 self.assertEqual('{0:F}'.format(-INF+0j), '-INF+0.000000j')
631 self.assertEqual('{0:f}'.format(complex(INF, INF)), 'inf+infj')
632 self.assertEqual('{0:F}'.format(complex(INF, INF)), 'INF+INFj')
633 self.assertEqual('{0:f}'.format(complex(INF, -INF)), 'inf-infj')
634 self.assertEqual('{0:F}'.format(complex(INF, -INF)), 'INF-INFj')
635 self.assertEqual('{0:f}'.format(complex(-INF, INF)), '-inf+infj')
636 self.assertEqual('{0:F}'.format(complex(-INF, INF)), '-INF+INFj')
637 self.assertEqual('{0:f}'.format(complex(-INF, -INF)), '-inf-infj')
638 self.assertEqual('{0:F}'.format(complex(-INF, -INF)), '-INF-INFj')
640 self.assertEqual('{0:f}'.format(complex(NAN, 0)), 'nan+0.000000j')
641 self.assertEqual('{0:F}'.format(complex(NAN, 0)), 'NAN+0.000000j')
642 self.assertEqual('{0:f}'.format(complex(NAN, NAN)), 'nan+nanj')
643 self.assertEqual('{0:F}'.format(complex(NAN, NAN)), 'NAN+NANj')