a ze&@sVddlZddlmZddlmZddlZddlZGdddejZe dkrRe dS)N) list_tests) cpython_onlycseZdZeZddZddZfddZddZfd d Z d d Z d dZ ddZ ddZ ddZddZddZeddZddZZS)ListTestcCs|tgggd}t|}||||||u|tdg|tdgd|tdg|tdgd|tddtdDgd tjd kr|ttttjd g}|d d|D||gdS) N)rZspam)spamcss|]}|dr|VqdS)rNr).0xrrB/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_list.py z&ListTest.test_basic.. )rr ircss|] }| VqdSNr)ryrrrr*r) assertEquallist assertTruerangesysmaxsize assertRaises MemoryErrorextend)selfZl0_3Zl0_3_bisrrrr test_basic s"  zListTest.test_basiccCs:|tdtgdWdn1s,0YdS)Nzkeyword argument)Zsequence)ZassertRaisesRegex TypeErrorrr"rrrtest_keyword_args-szListTest.test_keyword_argscs&t|g |dgdS)N*)super test_truthrr% __class__rrr)1s  zListTest.test_truthcCs|ggudSr)rr%rrr test_identity6szListTest.test_identitycsDt|tgd|tdgd|tgdddS)Nrr)rrrr)r(test_lenrlenr%r*rrr-9s zListTest.test_lencCs^gd}ttjddt|}dd}dd}|ttf||||ttf|||dS)NrrrcSs||Srrr brrrmulBrz#ListTest.test_overflow..mulcSs ||9}dSrrr2rrrimulCrz$ListTest.test_overflow..imul)intrrr.rr OverflowError)r"lstnr4r5rrr test_overflow?s zListTest.test_overflowcs fdd}|d|ddS)Ncs6dg|}t|}|dddg|ddS)Nr[z, 0])reprrjoin)r9lr r%rrcheckIs  z'ListTest.test_repr_large..checkri@Br)r"rArr%rtest_repr_largeGs zListTest.test_repr_largec Cs|gd}gd}ttjdD]v}t|}t||f|}t|\}}||dd<|t|t||t ||t |t||f|}t|\}}||dd<|t|t||t ||ddtdt |D] }t |qt||f|}t|\}}||dd<|t|t||t ||t |d| t t |t||f|}t|\}}||dd<|t |gq$dS)Nr/r r) type2testrpickleHIGHEST_PROTOCOLiterdumpsloadsrtypernextr.r StopIteration r"ZorigdataprotoZitorigditr irrrtest_iterator_pickleQs6     zListTest.test_iterator_picklec Cs|gd}gd}ttjdD]}t|}t||f|}t|\}}||dd<|t|t||t ||t |dddt |t||f|}t|\}}||dd<|t|t||t ||t |dddtdt |D]}t |qt||f|}t|\}}||dd<|t|t||t |g| t t |t||f|}t|\}}||dd<|t |gq$dS)Nr/rCrr)rIrrJrKreversedrMrNrrOrr.rPrrQrRrrrtest_reversed_pickleus6 " "   zListTest.test_reversed_picklecCs8gd}dg|ddtj<||ddtjdgdS)N)rrrrr0rrr)rrr)r"r rrrtest_step_overflowszListTest.test_step_overflowcCsNGdddt}|t d|ddgWdn1s@0YdS)Nc@s eZdZdS)z*ListTest.test_no_comdat_folding..LN)__name__ __module__ __qualname__rrrrLrr`)rrr)rrr$)r"r`rrrtest_no_comdat_foldings zListTest.test_no_comdat_foldingcstGfddd}Gfddd}Gfddd}|g|g|k|gdg}||kdS)NcseZdZfddZdS)z9ListTest.test_equal_operator_modifying_operand..Xcs tSrclearNotImplementedr"otherlist2rr__eq__sz@ListTest.test_equal_operator_modifying_operand..X.__eq__Nr]r^r_rirrgrrXsrkcseZdZfddZdS)z9ListTest.test_equal_operator_modifying_operand..Ycs tSrrbrelist1rrrisz@ListTest.test_equal_operator_modifying_operand..Y.__eq__NrjrrlrrYsrncseZdZfddZdS)z9ListTest.test_equal_operator_modifying_operand..Zcs tSrrbrelist3rrrisz@ListTest.test_equal_operator_modifying_operand..Z.__eq__NrjrrorrZsrqr)rZ assertFalse)r"rkrnrqZlist4r)rmrhrpr%test_equal_operator_modifying_operandsz.ListTest.test_equal_operator_modifying_operandcCsNdgd}t|}||ttdgd||tttddS)Nrr)r getsizeofrrr)r"iterableZ iter_sizerrrtest_preallocations  zListTest.test_preallocationcsGfddd}|g|tWdn1sD0YGdddt}||g||g|tWdn1s0Y||gdv||g|vdS)NcseZdZfddZdS)z3ListTest.test_count_index_remove_crashes..Xcs tSrrbrer8rrrisz:ListTest.test_count_index_remove_crashes..X.__eq__Nrjrrvrrrksrkc@seZdZddZdS)z3ListTest.test_count_index_remove_crashes..LcSs t|tSr)strrdrerrrrisz:ListTest.test_count_index_remove_crashes..L.__eq__Nrjrrrrr`sr`r)r ValueErrorindexrcountremove)r"rkr`rrvrtest_count_index_remove_crashess (    (  z(ListTest.test_count_index_remove_crashes)r]r^r_rrIr#r&r)r,r-r:rBrXr[r\rarrrrur| __classcell__rrr*rrs #   $$ r__main__) rtestrZ test.supportrrJZunittestZ CommonTestrr]mainrrrrs  b