mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 18:32:29 +00:00
23 lines
745 B
C++
23 lines
745 B
C++
#include <gtest/gtest.h>
|
|
#include <Core/Field.h>
|
|
|
|
using namespace DB;
|
|
|
|
GTEST_TEST(Field, Move)
|
|
{
|
|
Field f;
|
|
|
|
f = Field{String{"Hello, world (1)"}};
|
|
ASSERT_EQ(f.get<String>(), "Hello, world (1)");
|
|
f = Field{String{"Hello, world (2)"}};
|
|
ASSERT_EQ(f.get<String>(), "Hello, world (2)");
|
|
f = Field{Array{Field{String{"Hello, world (3)"}}}};
|
|
ASSERT_EQ(f.get<Array>()[0].get<String>(), "Hello, world (3)");
|
|
f = String{"Hello, world (4)"};
|
|
ASSERT_EQ(f.get<String>(), "Hello, world (4)");
|
|
f = Array{Field{String{"Hello, world (5)"}}};
|
|
ASSERT_EQ(f.get<Array>()[0].get<String>(), "Hello, world (5)");
|
|
f = Array{String{"Hello, world (6)"}};
|
|
ASSERT_EQ(f.get<Array>()[0].get<String>(), "Hello, world (6)");
|
|
}
|