mkql_unboxed_value_stream_ut.cpp 668 B

1234567891011121314151617181920212223
  1. #include "mkql_alloc.h"
  2. #include "mkql_unboxed_value_stream.h"
  3. #include <library/cpp/testing/unittest/registar.h>
  4. using namespace NYql;
  5. using namespace NKikimr::NMiniKQL;
  6. Y_UNIT_TEST_SUITE(TMiniKQLUnboxedValueStream) {
  7. Y_UNIT_TEST(Output) {
  8. TScopedAlloc alloc(__LOCATION__);
  9. TUnboxedValueStream out;
  10. for (int i = -128; i <= 127; ++i) {
  11. out << char(i);
  12. }
  13. const NUdf::TUnboxedValue val = out.Value();
  14. UNIT_ASSERT(val.HasValue());
  15. UNIT_ASSERT_VALUES_EQUAL(256, val.AsStringRef().Size());
  16. const NUdf::TUnboxedValue remains = out.Value();
  17. UNIT_ASSERT(!remains.HasValue());
  18. }
  19. }