From 0856339b7d509e66d6d15175305e92bda935f97e Mon Sep 17 00:00:00 2001 From: hadley Date: Tue, 24 Apr 2018 09:23:40 -0500 Subject: [PATCH] Add utf-8 test --- tests/testthat/test-bq-download.R | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/testthat/test-bq-download.R b/tests/testthat/test-bq-download.R index a9538fbf..a29611e6 100644 --- a/tests/testthat/test-bq-download.R +++ b/tests/testthat/test-bq-download.R @@ -30,6 +30,16 @@ test_that("can retrieve zero rows", { # types ------------------------------------------------------------------- +test_that("can read utf-8 strings", { + sql <- "SELECT '\U0001f603' as x" + tb <- bq_project_query(bq_test_project(), sql) + df <- bq_table_download(tb) + x <- df$x[[1]] + + expect_equal(Encoding(x), "UTF-8") + expect_equal(x, "\U0001f603") +}) + test_that("can convert date time types", { sql <- "SELECT datetime,