Skip to content

Commit

Permalink
Add tests for changed td translations
Browse files Browse the repository at this point in the history
Modified the test for as.double
Modified and added a new test for as.character
  • Loading branch information
rplsmn committed Oct 16, 2024
1 parent c898924 commit e66987e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/testthat/test-backend-teradata.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ test_that("custom scalar translated correctly", {
expect_equal(test_translate_sql(x != y), sql("`x` <> `y`"))
expect_equal(test_translate_sql(as.numeric(x)), sql("CAST(`x` AS DECIMAL(12, 9))"))
expect_equal(test_translate_sql(as.numeric(x, 8)), sql("CAST(`x` AS DECIMAL(12, 8))"))
expect_equal(test_translate_sql(as.double(x)), sql("CAST(`x` AS NUMERIC)"))
expect_equal(test_translate_sql(as.character(x)), sql("CAST(`x` AS VARCHAR(MAX))"))
expect_equal(test_translate_sql(as.double(x)), sql("CAST(`x` AS FLOAT)"))
expect_equal(test_translate_sql(as.character(x)), sql("CAST(`x` AS VARCHAR(255))"))
expect_equal(test_translate_sql(as.character(x, 12)), sql("CAST(`x` AS VARCHAR(12))"))
expect_equal(test_translate_sql(log(x)), sql("LN(`x`)"))
expect_equal(test_translate_sql(cot(x)), sql("1 / TAN(`x`)"))
expect_equal(test_translate_sql(nchar(x)), sql("CHARACTER_LENGTH(`x`)"))
Expand Down

0 comments on commit e66987e

Please sign in to comment.