From 252db48d8680d1ca5a97b5c7d9e9dc4dd4f2a48d Mon Sep 17 00:00:00 2001 From: fnc12 Date: Thu, 23 Jan 2020 20:02:17 +0300 Subject: [PATCH] added two or more spaces support --- dev/sqlite_type.h | 2 +- include/sqlite_orm/sqlite_orm.h | 2 +- tests/tests2.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/sqlite_type.h b/dev/sqlite_type.h index 5658e16cd..a3b09535f 100644 --- a/dev/sqlite_type.h +++ b/dev/sqlite_type.h @@ -43,7 +43,7 @@ namespace sqlite_orm { std::regex("UNSIGNED BIG INT"), std::regex("INT2"), std::regex("INT8"), - std::regex("UNSIGNED INT\\([[:digit:]]+\\)"), + std::regex("UNSIGNED\\s+INT\\([[:digit:]]+\\)"), }}, {sqlite_type::TEXT, { diff --git a/include/sqlite_orm/sqlite_orm.h b/include/sqlite_orm/sqlite_orm.h index 9f060c73a..2c9a01536 100644 --- a/include/sqlite_orm/sqlite_orm.h +++ b/include/sqlite_orm/sqlite_orm.h @@ -173,7 +173,7 @@ namespace sqlite_orm { std::regex("UNSIGNED BIG INT"), std::regex("INT2"), std::regex("INT8"), - std::regex("UNSIGNED INT\\([[:digit:]]+\\)"), + std::regex("UNSIGNED\\s+INT\\([[:digit:]]+\\)"), }}, {sqlite_type::TEXT, { diff --git a/tests/tests2.cpp b/tests/tests2.cpp index 9dcc9f3f4..9b1172768 100644 --- a/tests/tests2.cpp +++ b/tests/tests2.cpp @@ -419,6 +419,7 @@ TEST_CASE("Type parsing") { REQUIRE(*to_sqlite_type("INT2") == sqlite_type::INTEGER); REQUIRE(*to_sqlite_type("INT8") == sqlite_type::INTEGER); REQUIRE(*to_sqlite_type("UNSIGNED INT(6)") == sqlite_type::INTEGER); + REQUIRE(*to_sqlite_type("UNSIGNED INT(4)") == sqlite_type::INTEGER); // text REQUIRE(*to_sqlite_type("TEXT") == sqlite_type::TEXT);