From 20c3c5ce41c522d1e16f996bd9cecf7b32e1c6d5 Mon Sep 17 00:00:00 2001 From: Jacyking <791026912@qq.com> Date: Tue, 11 Jul 2023 13:47:44 +0800 Subject: [PATCH] add unit test "create table with unique on sqlite" --- tests/test_ormpp.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_ormpp.cpp b/tests/test_ormpp.cpp index b5a2f747..bad5672c 100644 --- a/tests/test_ormpp.cpp +++ b/tests/test_ormpp.cpp @@ -878,6 +878,17 @@ TEST_CASE("orm_aop") { // REQUIRE(r); } +#ifdef ORMPP_ENABLE_SQLITE3 +TEST_CASE("test create table with unique") { + dbng sqlite; + if (sqlite.connect(db)) { + sqlite.execute("drop table if exists person"); + CHECK(sqlite.create_datatable(ormpp_auto_key{"id"}, + ormpp_unique{"name"})); + } +} +#endif + #ifdef ORMPP_ENABLE_MYSQL struct image { int id;