Commit eeceb504 authored by Leonardo Silvestri's avatar Leonardo Silvestri
Browse files

change to map to 'ztsdb' change to 'nanotime' nomenclature

parent 74d5bb70
......@@ -8,16 +8,16 @@ test_bool_scalar <- function() {
checkEquals(TRUE, c1 ? TRUE)
}
test_time_scalar <- function() {
checkEquals(as.nanotime("1970-01-01 UTC"), c1 ? as.time("1970-01-01 00:00:00 UTC"))
checkEquals(as.nanotime("1970-01-01 UTC"), c1 ? as.nanotime("1970-01-01 00:00:00 UTC"))
}
test_string_scalar <- function() {
checkEquals("how soon is now?", c1 ? "how soon is now?")
}
test_duration_scalar <- function() {
checkEquals(as.nanoduration(10), c1 ? as.duration(10))
checkEquals(as.nanoduration(10), c1 ? as.nanoduration(10))
}
test_interval_scalar <- function() {
checkEquals(as.nanoduration(10), c1 ? as.duration(10))
checkEquals(as.nanoduration(10), c1 ? as.nanoduration(10))
}
## vectors;
......@@ -41,8 +41,8 @@ test_bool <- function() {
checkEquals(matrix(c(T,T,F,F), 2, 2), c1 ? matrix(c(T,T,F,F), 2, 2))
}
test_time <- function() {
checkEquals(as.POSIXct("1970-01-01", tz="UTC") + 1:10,
c1 ? as.time("1970-01-01 00:00:00 UTC") + 1:10*as.duration(1e9))
checkEquals(nanotime("1970-01-01 UTC") + 1:10*as.nanoduration(1e9),
c1 ? as.nanotime("1970-01-01 00:00:00 UTC") + 1:10*as.nanoduration(1e9))
}
test_string <- function() {
checkEquals(matrix(as.character(1:10), 5, 2), c1 ? matrix(as.character(1:10), 5, 2))
......@@ -50,7 +50,7 @@ test_string <- function() {
# zts may have tzone difference, so here again don't use checkEquals
test_zts <- function() {
x <- data.table(index=as.nanotime("1970-01-01 UTC") + 1:9, V1=1:9)
z <- (c1 ? zts(as.time("1970-01-01 00:00:00 UTC") + 1:9*as.duration(1e9), 1:9))
z <- (c1 ? zts(as.nanotime("1970-01-01 00:00:00 UTC") + 1:9*as.nanoduration(1e9), 1:9))
checkEquals(x, z)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment