()
| 764 | |
| 765 | |
| 766 | def test_removesuffix(): |
| 767 | s = "foobarfoo" |
| 768 | s_ref = "foobarfoo" |
| 769 | assert s.removesuffix("o") == s_ref[:-1] |
| 770 | assert s.removesuffix("oo") == s_ref[:-2] |
| 771 | assert s.removesuffix("foo") == s_ref[:-3] |
| 772 | |
| 773 | assert s.removesuffix("") == s_ref |
| 774 | assert s.removesuffix("bar") == s_ref |
| 775 | assert s.removesuffix("lol") == s_ref |
| 776 | assert s.removesuffix("foo_") == s_ref |
| 777 | assert s.removesuffix("foo-") == s_ref |
| 778 | assert s.removesuffix("foo*") == s_ref |
| 779 | assert s.removesuffix("fooa") == s_ref |
| 780 | |
| 781 | assert s == s_ref, "undefined test fail" |
| 782 | |
| 783 | s_uc = "😱foobarfoo🖖" |
| 784 | s_ref_uc = "😱foobarfoo🖖" |
| 785 | assert s_uc.removesuffix("🖖") == s_ref_uc[:-1] |
| 786 | assert s_uc.removesuffix("oo🖖") == s_ref_uc[:-3] |
| 787 | assert s_uc.removesuffix("foo🖖") == s_ref_uc[:-4] |
| 788 | |
| 789 | assert s_uc.removesuffix("😱") == s_ref_uc |
| 790 | assert s_uc.removesuffix("foo") == s_ref_uc |
| 791 | assert s_uc.removesuffix(" ") == s_ref_uc |
| 792 | assert s_uc.removesuffix("🖖_") == s_ref_uc |
| 793 | assert s_uc.removesuffix("🖖 ") == s_ref_uc |
| 794 | assert s_uc.removesuffix("🖖-") == s_ref_uc |
| 795 | assert s_uc.removesuffix("🖖#") == s_ref_uc |
| 796 | |
| 797 | |
| 798 | def test_removesuffix_types(): |
nothing calls this directly
no test coverage detected