#include #include #include #include #include #include #include #include #include namespace NYql { Y_UNIT_TEST_SUITE(TPGPackTests) { Y_UNIT_TEST(UnknownTypeAsString) { using namespace NKikimr::NMiniKQL; TScopedAlloc alloc(__LOCATION__); TTypeEnvironment env(alloc); TIntrusivePtr functionRegistry(CreateFunctionRegistry(CreateBuiltinRegistry())); TProgramBuilder pgmBuilder(env, *functionRegistry); TMemoryUsageInfo memInfo("Memory"); THolderFactory holderFactory(alloc.Ref(), memInfo, functionRegistry.Get()); auto pgType = pgmBuilder.NewPgType(0xffffffff); TValuePacker pgPacker(false, pgType); NUdf::TUnboxedValue s = MakeString(NUdf::TStringRef::Of("foo")); auto p = pgPacker.Pack(s); auto u = pgPacker.Unpack(p, holderFactory); UNIT_ASSERT_VALUES_EQUAL(TStringBuf(u.AsStringRef()), "foo"); } } }