Skip to content

Commit

Permalink
tests/utils: use more general regexes to match timestamps.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMatula committed Aug 6, 2019
1 parent 976f07d commit 4f565af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/utils/time_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
#include <string>

#include <gtest/gtest.h>
#include <gmock/gmock.h>

#include "retdec/utils/os.h"
#include "retdec/utils/time.h"

using namespace ::testing;
//using ::testing::MatchesRegex;

namespace retdec {
namespace utils {
Expand Down Expand Up @@ -81,7 +83,9 @@ class TimeTests: public Test {

TEST_F(TimeTests,
CorrectTimestampToDateConversion) {
EXPECT_EQ("2015-08-05T14:25:19+0000", timestampToDate(std::time_t(1438784719)));
EXPECT_THAT(
timestampToDate(std::time_t(1438784719)),
MatchesRegex("2015-08-05T14:25:19[-+][0-9]{4}"));
}

} // namespace tests
Expand Down

0 comments on commit 4f565af

Please sign in to comment.