Skip to content

Commit e3c1f92

Browse files
committed
revert: shouldn't have touched these files
1 parent f6f6b0d commit e3c1f92

2 files changed

Lines changed: 6 additions & 27 deletions

File tree

R/asFactorSimpleDS.R

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@
1616
#'
1717
asFactorSimpleDS <- function(input.var.name=NULL){
1818

19-
input.var <- .loadServersideObject(input.var.name)
20-
.checkClass(
21-
obj = input.var,
22-
obj_name = input.var.name,
23-
permitted_classes = c("numeric", "integer", "character", "factor")
24-
)
19+
input.var <- eval(parse(text=input.var.name), envir = parent.frame())
2520

2621
factor.obj <- factor(input.var)
2722

@@ -32,3 +27,4 @@ asFactorSimpleDS <- function(input.var.name=NULL){
3227

3328
#ASSIGN FUNCTION
3429
# asFactorSimpleDS
30+

tests/testthat/test-smk-asFactorSimpleDS.R

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#-------------------------------------------------------------------------------
22
# Copyright (c) 2019-2022 University of Newcastle upon Tyne. All rights reserved.
3-
# Copyright (c) 2022-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved.
43
#
54
# This program and the accompanying materials
65
# are made available under the terms of the GNU Public License v3.0.
@@ -13,15 +12,15 @@
1312
# Set up
1413
#
1514

16-
# context("asFactorSimpleDS::smk::setup")
15+
context("asFactorSimpleDS::smk::setup")
1716

1817
set.standard.disclosure.settings()
1918

2019
#
2120
# Tests
2221
#
2322

24-
# context("asFactorSimpleDS::smk::simple")
23+
context("asFactorSimpleDS::smk::simple")
2524
test_that("simple asFactorSimpleDS", {
2625
input <- c(2.0, 1.0, 3.0, 3.0, 3.0, 1.0, 2.0, 2.0, 1.0, 2.0)
2726

@@ -49,26 +48,10 @@ test_that("simple asFactorSimpleDS", {
4948
expect_equal(res.levels[3], "3")
5049
})
5150

52-
# context("asFactorSimpleDS::smk::error")
53-
test_that("asFactorSimpleDS throws error when object does not exist", {
54-
expect_error(
55-
asFactorSimpleDS("nonexistent_object"),
56-
regexp = "does not exist"
57-
)
58-
})
59-
60-
test_that("asFactorSimpleDS throws error when object is not numeric or character", {
61-
bad_input <- list(a = 1, b = 2)
62-
expect_error(
63-
asFactorSimpleDS("bad_input"),
64-
regexp = "must be of type"
65-
)
66-
})
67-
6851
#
6952
# Done
7053
#
7154

72-
# context("asFactorSimpleDS::smk::shutdown")
55+
context("asFactorSimpleDS::smk::shutdown")
7356

74-
# context("asFactorSimpleDS::smk::done")
57+
context("asFactorSimpleDS::smk::done")

0 commit comments

Comments
 (0)