Skip to content

Commit 18af159

Browse files
feat: Test object returned by dbUnquoteIdentifier() is of class Id
1 parent b0cebc1 commit 18af159

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

R/spec-sql-unquote-identifier.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ spec_sql_unquote_identifier <- list(
2222
simple_in <- dbQuoteIdentifier(con, "simple")
2323
simple_out <- dbUnquoteIdentifier(con, simple_in)
2424
expect_equal(length(simple_out), 1L)
25+
expect_s4_class(simple_out[[1L]], "Id")
2526

2627
letters_in <- dbQuoteIdentifier(con, letters)
2728
letters_out <- dbUnquoteIdentifier(con, letters_in)
2829
expect_equal(length(letters_out), length(letters_in))
30+
for (obj in letters_out) expect_s4_class(obj, "Id")
2931

3032
#' For an empty vector, this function returns a length-0 object.
3133
empty <- character()
@@ -44,6 +46,7 @@ spec_sql_unquote_identifier <- list(
4446
named_in <- dbQuoteIdentifier(con, stats::setNames(LETTERS[1:3], letters[1:3]))
4547
named_out <- dbUnquoteIdentifier(con, named_in)
4648
expect_equal(names(named_out), letters[1:3])
49+
for (obj in named_out) expect_s4_class(obj, "Id")
4750

4851
#' If `x` is a value returned by `dbUnquoteIdentifier()`,
4952
#' calling `dbUnquoteIdentifier(..., dbQuoteIdentifier(..., x))`

0 commit comments

Comments
 (0)