Skip to content

Commit

Permalink
update unit_test
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzq50 committed Dec 28, 2023
1 parent 6cef6c9 commit 6d0cb23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/unit_test/function/scalar/extract_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

#include "unit_test/base_test.h"
#include <iomanip>

import infinity_exception;

Expand Down Expand Up @@ -80,7 +81,7 @@ TEST_F(ExtractFunctionTest, extract_year_test) {
Value v = data_block.GetValue(0, i);
EXPECT_EQ(v.type_.type(), LogicalType::kDate);
std::stringstream ss;
ss << i + 1 << "-01-01";
ss << std::setfill('0') << std::setw(4) << i + 1 << "-01-01";
EXPECT_EQ(v.value_.date.ToString(), ss.str());
}

Expand Down
2 changes: 1 addition & 1 deletion src/unit_test/parser/type/datetime/date_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TEST_F(DateTypeTest, test1) {
EXPECT_EQ(date1.ToString(), "2000-10-31");

date1.FromString("1-1-1");
EXPECT_EQ(date1.ToString(), "1-01-01");
EXPECT_EQ(date1.ToString(), "0001-01-01");

date1.FromString("9999-12-31");
EXPECT_EQ(date1.ToString(), "9999-12-31");
Expand Down

0 comments on commit 6d0cb23

Please sign in to comment.