Skip to content

Commit 8e7253c

Browse files
authored
Merge pull request #1291 from jakemumu/add_quick_check_pragma_unit_test
Quick Check Pragma Test
2 parents 1faeed4 + 1f0fcc0 commit 8e7253c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/pragma_tests.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,29 @@ TEST_CASE("Integrity Check") {
151151
REQUIRE(storage.pragma.integrity_check(tablename) == std::vector<std::string>{"ok"});
152152
}
153153

154+
TEST_CASE("Quick Check") {
155+
struct User {
156+
int id;
157+
std::string name;
158+
int age;
159+
std::string email;
160+
};
161+
162+
auto filename = "quick_check.sqlite";
163+
::remove(filename);
164+
165+
std::string tablename = "users";
166+
auto storage = make_storage(filename,
167+
make_table(tablename,
168+
make_column("id", &User::id, primary_key()),
169+
make_column("name", &User::name),
170+
make_column("age", &User::age),
171+
make_column("email", &User::email, default_value("[email protected]"))));
172+
storage.sync_schema();
173+
174+
REQUIRE(storage.pragma.quick_check() == std::vector<std::string>{"ok"});
175+
}
176+
154177
TEST_CASE("application_id") {
155178
auto filename = "application_id.sqlite";
156179
::remove(filename);

0 commit comments

Comments
 (0)