MCPcopy Create free account
hub / github.com/catboost/catboost / Y_UNIT_TEST

Function Y_UNIT_TEST

util/draft/date_ut.cpp:6–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5Y_UNIT_TEST_SUITE(TDateTest) {
6 Y_UNIT_TEST(ComponentsTest) {
7 {
8 TDate d("20110215");
9 UNIT_ASSERT_EQUAL(d.GetYear(), 2011);
10 UNIT_ASSERT_EQUAL(d.GetMonth(), 2);
11 UNIT_ASSERT_EQUAL(d.GetMonthDay(), 15);
12 UNIT_ASSERT_EQUAL(d.ToStroka("%Y%m%d"), "20110215");
13 UNIT_ASSERT_EQUAL(d.ToStroka(), "20110215");
14 UNIT_ASSERT_EQUAL(d.ToStroka("%Y--%m--%d"), "2011--02--15");
15 UNIT_ASSERT_EQUAL(d.ToStroka("%U"), "07");
16 UNIT_ASSERT_EQUAL(d.GetStartUTC(), 1297728000);
17 }
18 {
19 TDate d(2005, 6, 3);
20 UNIT_ASSERT_EQUAL(d.GetYear(), 2005);
21 UNIT_ASSERT_EQUAL(d.GetMonth(), 6);
22 UNIT_ASSERT_EQUAL(d.GetMonthDay(), 3);
23 UNIT_ASSERT_EQUAL(d.ToStroka(), "20050603");
24 UNIT_ASSERT_EQUAL(d.ToStroka("____%Y__%m____%d"), "____2005__06____03");
25 UNIT_ASSERT_EQUAL(d.GetStartUTC(), 1117756800);
26 }
27 {
28 TDate d("2011-02-15", "%Y-%m-%d");
29 UNIT_ASSERT_EQUAL(d.GetYear(), 2011);
30 UNIT_ASSERT_EQUAL(d.GetMonth(), 2);
31 UNIT_ASSERT_EQUAL(d.GetMonthDay(), 15);
32 UNIT_ASSERT_EQUAL(d.ToStroka("%Y%m%d"), "20110215");
33 UNIT_ASSERT_EQUAL(d.GetStartUTC(), 1297728000);
34 }
35 }
36} // Y_UNIT_TEST_SUITE(TDateTest)

Callers

nothing calls this directly

Calls 5

GetYearMethod · 0.80
GetMonthMethod · 0.80
GetMonthDayMethod · 0.80
ToStrokaMethod · 0.80
GetStartUTCMethod · 0.80

Tested by

no test coverage detected