def METHOD_NAME(cls, capfd):
    with capfd.disabled():
        o = CapList()
        r = cls("stdout", cbs=[o.append])
        r.install()
        s = "QWERT\nYUIOP\n12345"
        s += "\r"
        s += "\x1b[J"
        s += "\x1b[A"
        s += "\r"
        s += "\x1b[1J"
        print(s)
        r.uninstall()
        assert o == [b" UIOP"]
        o = CapList()
        r = cls("stdout", cbs=[o.append])
        r.install()
        print("QWERT\nYUIOP\n12345")
        print("\x1b[2J")
        r.uninstall()
        assert o == []