Skip to content

Commit

Permalink
Remove old test code
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanCutler committed Sep 23, 2024
1 parent 918598f commit e4f984a
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions velox/functions/prestosql/tests/UuidFunctionsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,6 @@ TEST_F(UuidFunctionsTest, comparisons) {
const auto uuidEval = [&](const std::optional<std::string>& lhs, const std::string& operation, const std::optional<std::string>& rhs) {
return evaluateOnce<bool>(fmt::format("cast(c0 as uuid) {} cast(c1 as uuid)", operation), lhs, rhs);
};
/*const auto uuidComparison = [&](const std::string& operation, const std::optional<std::string>& lhs, const std::optional<std::string>& rhs) {
return evaluateOnce<bool>(fmt::format("cast(c0 as uuid) {} cast(c1 as uuid)", operation), lhs, rhs);
};
const auto uuidLt = std::bind(uuidComparison, ">", std::placeholders::_1, std::placeholders::_2);
const auto uuidGt = std::bind(uuidComparison, ">", std::placeholders::_1, std::placeholders::_2);
const auto uuidLtEq = std::bind(uuidComparison, "<=", std::placeholders::_1, std::placeholders::_2);
const auto uuidGtEq = std::bind(uuidComparison, ">", std::placeholders::_1, std::placeholders::_2);
const auto uuidEq = std::bind(uuidComparison, "==", std::placeholders::_1, std::placeholders::_2);
const auto uuidNotEq = std::bind(uuidComparison, "!=", std::placeholders::_1, std::placeholders::_2);*/

ASSERT_EQ(uuidEval("33355449-2c7d-43d7-967a-f53cd23215ad", "<", "ffffffff-ffff-ffff-ffff-ffffffffffff"), true);
ASSERT_EQ(uuidEval("33355449-2c7d-43d7-967a-f53cd23215ad", "<", "00000000-0000-0000-0000-000000000000"), false);
Expand All @@ -139,64 +130,6 @@ TEST_F(UuidFunctionsTest, comparisons) {
ASSERT_EQ(uuidEval("00000000-0000-0000-2200-000000000011", ">", "00000000-0000-0000-1100-000000000022"), true);
ASSERT_EQ(uuidEval("00000000-0000-0000-0000-000000000011", ">", "22000000-0000-0000-0000-000000000000"), false);
ASSERT_EQ(uuidEval("11000000-0000-0000-0000-000000000000", "<", "00000000-0000-0000-0000-000000000022"), false);


/*auto data0 = makeFlatVector<std::string>({
"33355449-2c7d-43d7-967a-f53cd23215ad",
"33355449-2c7d-43d7-967a-f53cd23215ad",
});
auto data1 = makeFlatVector<std::string>({
"43355449-2c7d-43c7-967a-f53cd23215ad",
"23355449-2c7d-43e7-967a-f53cd23215ad",
});
auto actual = evaluate("cast(c0 as uuid) < cast(c1 as uuid)", makeRowVector({data0, data1}));
auto expected = makeFlatVector<bool>({true, false});
velox::test::assertEqualVectors(expected, actual);*/

/*
auto data0 = makeFlatVector<std::string>({
"33355449-2c7d-43d7-967a-f53cd23215ad",
"eed9f812-4b0c-472f-8a10-4ae7bff79a47",
"f768f36d-4f09-4da7-a298-3564d8f3c986",
"eed9f812-4b0c-472f-8a10-4ae7bff79a47",
"f768f36d-4f09-4da7-a298-3564d8f3c986",
"33355449-2c7d-43d7-967a-f53cd23215ad",
});
auto data1 = makeFlatVector<std::string>({
"00000000-0000-0000-0000-000000000000",
"ffffffff-ffff-ffff-ffff-ffffffffffff",
"f768f36d-4f09-4da7-0000-000000000000",
"eed9f812-4b0c-472f-ffff-ffffffffffff",
"a768f36d-4f09-4da7-a298-3564d8f3c986",
"33355449-2c7d-43d7-967a-f53cd23215ad",
});
auto actual = evaluate("cast(c0 as uuid) < cast(c1 as uuid)", makeRowVector({data0, data1}));
auto expected = makeFlatVector<bool>({false, true, false, true, false, false});
velox::test::assertEqualVectors(expected, actual);
actual = evaluate("cast(c0 as uuid) > cast(c1 as uuid)", makeRowVector({data0, data1}));
expected = makeFlatVector<bool>({true, false, true, false, true, false});
velox::test::assertEqualVectors(expected, actual);
actual = evaluate("cast(c0 as uuid) <= cast(c1 as uuid)", makeRowVector({data0, data1}));
expected = makeFlatVector<bool>({false, true, false, true, false, true});
velox::test::assertEqualVectors(expected, actual);
actual = evaluate("cast(c0 as uuid) >= cast(c1 as uuid)", makeRowVector({data0, data1}));
expected = makeFlatVector<bool>({true, false, true, false, true, true});
velox::test::assertEqualVectors(expected, actual);
actual = evaluate("cast(c0 as uuid) == cast(c1 as uuid)", makeRowVector({data0, data1}));
expected = makeFlatVector<bool>({false, false, false, false, false, true});
velox::test::assertEqualVectors(expected, actual);
actual = evaluate("cast(c0 as uuid) != cast(c1 as uuid)", makeRowVector({data0, data1}));
expected = makeFlatVector<bool>({true, true, true, true, true, false});
velox::test::assertEqualVectors(expected, actual);*/
}

} // namespace
Expand Down

0 comments on commit e4f984a

Please sign in to comment.