#include "tile/base/compression/util.h"

#include "gtest/gtest.h"

namespace tile {
namespace compression {
TEST(CopyDataToCompressionOutputStream, All)
{
    std::string s;
    std::string a = "123456789+";

    TestCompressionOutputStream out1(&s, 2);
    CopyDataToCompressionOutputStream(&out1, a.data(), 1);
    CopyDataToCompressionOutputStream(&out1, a.data() + 1, 2);
    CopyDataToCompressionOutputStream(&out1, a.data() + 3, 3);
    CopyDataToCompressionOutputStream(&out1, a.data() + 6, 4);
    out1.Flush();

    ASSERT_EQ(s, a);
}
}// namespace compression

}// namespace tile
