From bc2c123e123dd58735b9b5db05bd0046a9cc41b9 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sat, 15 Jun 2024 14:49:32 +0800 Subject: [PATCH] test: add export test suite for RangesUnion --- src/core_test/cases/ranges_union.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/core_test/cases/ranges_union.cc b/src/core_test/cases/ranges_union.cc index f85b217..d6a1d2d 100644 --- a/src/core_test/cases/ranges_union.cc +++ b/src/core_test/cases/ranges_union.cc @@ -1,11 +1,22 @@ #include +#include + +#include "hash.h" #include "helper/cases.h" #include "ranges/ranges.h" static_assert(std::is_base_of_v, RangesUnion>); -// TODO: test CommonCode export +constexpr std::string_view ALL_CASES_MD5 = "3888e9fab8d3cbb50908b12b147cfb23"; + +TEST(RangesUnion, export) { + std::string buffer; + for (auto code : AllCases::instance().fetch().codes()) { + buffer += std::format("{:09X}\n", code.unwrap()); + } + EXPECT_EQ(hash::md5(buffer), ALL_CASES_MD5); +} TEST(RangesUnion, operator) { Ranges r, r1, r2;