Skip to content

Commit f4897f4

Browse files
committed
Exports and inlines
1 parent b421f52 commit f4897f4

File tree

6 files changed

+32
-8
lines changed

6 files changed

+32
-8
lines changed

NAMESPACE

+7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ export(connect)
88
export(dbi_generics)
99
export(expect_all_args_have_default_values)
1010
export(expect_ellipsis_in_formals)
11+
export(expect_equal_df)
1112
export(expect_has_class_method)
1213
export(expect_invisible_true)
1314
export(get_default_context)
1415
export(get_key_methods)
16+
export(get_penguins)
1517
export(get_pkg_path)
1618
export(get_placeholder_funs)
1719
export(get_texts)
20+
export(has_utf8_or_ascii_encoding)
1821
export(local_connection)
1922
export(local_remove_test_table)
2023
export(local_result)
@@ -32,17 +35,21 @@ export(test_driver)
3235
export(test_getting_started)
3336
export(test_meta)
3437
export(test_result)
38+
export(test_select)
3539
export(test_select_bind)
3640
export(test_select_with_null)
3741
export(test_some)
3842
export(test_sql)
3943
export(test_stress)
44+
export(test_table_roundtrip)
45+
export(test_table_roundtrip_one)
4046
export(test_transaction)
4147
export(trivial_df)
4248
export(trivial_query)
4349
export(trivial_values)
4450
export(try_silent)
4551
export(tweaks)
52+
export(unrowname)
4653
import(testthat)
4754
importFrom(DBI,Id)
4855
importFrom(DBI,SQL)

R/expectations.R

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ expect_invisible_true <- function(code) {
4848
invisible(ret$value)
4949
}
5050

51+
#' @export
5152
expect_equal_df <- function(actual, expected) {
5253
factor_cols <- vapply(expected, is.factor, logical(1L))
5354
expected[factor_cols] <- lapply(expected[factor_cols], as.character)

R/spec-result-roundtrip.R

+2
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ test_select_with_null <- function(...) {
267267
test_select(..., .add_null = "below")
268268
}
269269

270+
#' @export
270271
test_select <- function(con, ..., .dots = NULL, .add_null = "none",
271272
.ctx, .envir = parent.frame()) {
272273
values <- c(list(...), .dots)
@@ -356,6 +357,7 @@ all_have_utf8_or_ascii_encoding <- function(x) {
356357
all(vapply(x, has_utf8_or_ascii_encoding, logical(1L)))
357358
}
358359

360+
#' @export
359361
has_utf8_or_ascii_encoding <- function(x) {
360362
if (Encoding(x) == "UTF-8") {
361363
TRUE

R/spec-sql-write-table.R

+2
Original file line numberDiff line numberDiff line change
@@ -822,12 +822,14 @@ spec_sql_write_table <- list(
822822
NULL
823823
)
824824

825+
#' @export
825826
test_table_roundtrip <- function(...) {
826827
test_table_roundtrip_one(..., .add_na = "none")
827828
test_table_roundtrip_one(..., .add_na = "above")
828829
test_table_roundtrip_one(..., .add_na = "below")
829830
}
830831

832+
#' @export
831833
test_table_roundtrip_one <- function(con, tbl_in, tbl_expected = tbl_in, transform = identity,
832834
name = NULL, field.types = NULL, use_append = FALSE, .add_na = "none") {
833835
force(tbl_expected)

R/use.R

+18-8
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,41 @@ use_dbitest <- function(path) {
2424
))
2525
usethis::use_import_from("DBItest", c(
2626
"get_default_context",
27+
"connect",
2728
"local_connection",
2829
"local_result",
29-
"connect",
30-
"trivial_query",
30+
"local_remove_test_table",
3131
"try_silent",
3232
"package_name",
3333
"get_pkg_path",
34-
"test_data_type",
35-
"expect_invisible_true",
3634
"s4_methods",
35+
"expect_invisible_true",
36+
"expect_equal_df",
3737
"expect_all_args_have_default_values",
3838
"expect_ellipsis_in_formals",
3939
"expect_has_class_method",
4040
"get_key_methods",
4141
"dbi_generics",
4242
"check_df",
43-
"test_select_bind",
44-
"new_bind_tester_extra",
4543
"random_table_name",
46-
"local_remove_test_table",
4744
"get_placeholder_funs",
45+
"has_utf8_or_ascii_encoding",
46+
#
47+
"trivial_query",
4848
"trivial_df",
4949
"trivial_values",
50-
"test_select_with_null",
50+
"get_penguins",
51+
#
5152
"get_texts",
53+
"unrowname",
54+
#
55+
"test_data_type",
56+
"test_select_with_null",
57+
"test_select",
58+
"test_select_bind",
59+
"new_bind_tester_extra",
60+
"test_table_roundtrip",
61+
"test_table_roundtrip_one",
5262
NULL
5363
))
5464

R/utils.R

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ local_remove_test_table <- function(con, name, frame = rlang::caller_env()) {
5353
)
5454
}
5555

56+
#' @export
5657
get_penguins <- function(ctx) {
5758
datasets_penguins <- unrowname(palmerpenguins::penguins[c(1, 153, 277), ])
5859
if (!isTRUE(ctx$tweaks$strict_identifier)) {
@@ -61,6 +62,7 @@ get_penguins <- function(ctx) {
6162
as.data.frame(datasets_penguins)
6263
}
6364

65+
#' @export
6466
unrowname <- function(x) {
6567
rownames(x) <- NULL
6668
x

0 commit comments

Comments
 (0)