5#include <gtest/gtest.h>
10#include "third_party/icu/source/i18n/unicode/timezone.h"
14TEST(RunnerTZDataTest, LoadsWithTZDataPresent) {
17 setenv(
"ICU_TIMEZONE_FILES_DIR",
"/pkg/data/tzdata",
true);
19 UErrorCode err = U_ZERO_ERROR;
20 const auto version_before = std::string(icu::TimeZone::getTZDataVersion(err));
21 ASSERT_EQ(U_ZERO_ERROR, err) <<
"unicode error: " << u_errorName(err);
25 bool success = Runner::SetupICUInternal();
26 ASSERT_TRUE(success) <<
"failed to load timezone data";
28 const auto version_after = std::string(icu::TimeZone::getTZDataVersion(err));
29 ASSERT_EQ(U_ZERO_ERROR, err) <<
"unicode error: " << u_errorName(err);
31 EXPECT_EQ(
"2019a", version_after);
TEST(RunnerTZDataTest, LoadsWithoutTZDataPresent)