From b3639036d972840fb52e9f9e12fda93c11561f0a Mon Sep 17 00:00:00 2001 From: Ger Inberg Date: Tue, 30 May 2023 10:17:55 +0200 Subject: [PATCH] #44 add table and col names test --- tests/testthat/test-basic.R | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/testthat/test-basic.R b/tests/testthat/test-basic.R index d650be1..e9aeaa8 100644 --- a/tests/testthat/test-basic.R +++ b/tests/testthat/test-basic.R @@ -30,6 +30,17 @@ test_that("Connect", { DatabaseConnector::disconnect(connection) }) +test_that("Table names and column names case", { + connection <- DatabaseConnector::connect(getEunomiaConnectionDetails()) + tableNames <- DatabaseConnector::getTableNames(connection) + expect_true(identical(tableNames, tolower(tableNames))) + + for (tableName in tableNames) { + colNames <- DatabaseConnector::dbListFields(connection, tableName) + expect_true(identical(colNames, tolower(colNames))) + } +}) + test_that("Query", { connection <- DatabaseConnector::connect(getEunomiaConnectionDetails()) personCount <- DatabaseConnector::querySql(connection, "SELECT COUNT(*) FROM main.person;")