-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathtest-arg-dataFrameFillDS.R
More file actions
55 lines (42 loc) · 1.88 KB
/
test-arg-dataFrameFillDS.R
File metadata and controls
55 lines (42 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#-------------------------------------------------------------------------------
# Copyright (c) 2019-2022 University of Newcastle upon Tyne. All rights reserved.
# Copyright (c) 2022-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved.
#
# This program and the accompanying materials
# are made available under the terms of the GNU Public License v3.0.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#
# Set up
#
# context("dataFrameFillDS::arg::setup")
#
# Tests
#
# context("dataFrameFillDS::arg")
test_that("simple dataFrameFillDS, ascending, numeric", {
df <- data.frame(v1 = c(-2.0, -3.0, 4.0, 2.0, 1.0, 0.0, -1.0, 3.0), v2 = c(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0))
allNames.transmit <- "v1,v2,v3,v4,v5,v6,v7"
class.vect.transmit <- "numeric,numeric,numeric,foo,bar,factor,logical"
levels.vec.transmit <- NULL
expect_error(res <- dataFrameFillDS("df", allNames.transmit, class.vect.transmit, levels.vec.transmit), "Unexpected missing class specified: 'foo'", fixed = TRUE)
expect_true(! exists("res"))
})
test_that("simple dataFrameFillDS, ascending, numeric", {
df <- data.frame(v1 = c(-2.0, -3.0, 4.0, 2.0, 1.0, 0.0, -1.0, 3.0), v2 = c(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0))
allNames.transmit <- "v1,v2,v3,v4,v5,v6,v7"
class.vect.transmit <- "numeric,numeric,numeric,foo,bar,factor,logical"
levels.vec.transmit <- NULL
expect_error(res <- dataFrameFillDS("df", allNames.transmit, class.vect.transmit, levels.vec.transmit), "Unexpected missing class specified: 'foo'", fixed = TRUE)
expect_true(! exists("res"))
})
#
# Shutdown
#
# context("dataFrameFillDS::arg::shutdown")
#
# Done
#
# context("dataFrameFillDS::arg::done")