def test_dump_integer(self, space):
        w_res = space.execute("return Marshal.dump(123)")
        assert space.str_w(w_res) == "\x04\bi\x01{"

        w_res = space.execute("return Marshal.dump(255)")
        assert space.str_w(w_res) == "\x04\bi\x01\xFF"

        w_res = space.execute("return Marshal.dump(256)")
        assert space.str_w(w_res) == "\x04\bi\x02\x00\x01"

        w_res = space.execute("return Marshal.dump(2 ** 16 - 2)")
        assert space.str_w(w_res) == "\x04\bi\x02\xFE\xFF"

        w_res = space.execute("return Marshal.dump(2 ** 16 - 1)")
        assert space.str_w(w_res) == "\x04\bi\x02\xFF\xFF"

        w_res = space.execute("return Marshal.dump(2 ** 16)")
        assert space.str_w(w_res) == "\x04\bi\x03\x00\x00\x01"

        w_res = space.execute("return Marshal.dump(2 ** 16 + 1)")
        assert space.str_w(w_res) == "\x04\bi\x03\x01\x00\x01"

        w_res = space.execute("return Marshal.dump(2 ** 30 - 1)")
        assert space.str_w(w_res) == "\x04\bi\x04\xFF\xFF\xFF?"

        # TODO: test tooo big numbers (they give a warning and inf)