|
1 | 1 | #------------------------------------------------------------------------------- |
2 | 2 | # 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. |
4 | 3 | # |
5 | 4 | # This program and the accompanying materials |
6 | 5 | # are made available under the terms of the GNU Public License v3.0. |
|
13 | 12 | # Set up |
14 | 13 | # |
15 | 14 |
|
16 | | -# context("asFactorSimpleDS::smk::setup") |
| 15 | +context("asFactorSimpleDS::smk::setup") |
17 | 16 |
|
18 | 17 | set.standard.disclosure.settings() |
19 | 18 |
|
20 | 19 | # |
21 | 20 | # Tests |
22 | 21 | # |
23 | 22 |
|
24 | | -# context("asFactorSimpleDS::smk::simple") |
| 23 | +context("asFactorSimpleDS::smk::simple") |
25 | 24 | test_that("simple asFactorSimpleDS", { |
26 | 25 | input <- c(2.0, 1.0, 3.0, 3.0, 3.0, 1.0, 2.0, 2.0, 1.0, 2.0) |
27 | 26 |
|
@@ -49,26 +48,10 @@ test_that("simple asFactorSimpleDS", { |
49 | 48 | expect_equal(res.levels[3], "3") |
50 | 49 | }) |
51 | 50 |
|
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 | | - |
68 | 51 | # |
69 | 52 | # Done |
70 | 53 | # |
71 | 54 |
|
72 | | -# context("asFactorSimpleDS::smk::shutdown") |
| 55 | +context("asFactorSimpleDS::smk::shutdown") |
73 | 56 |
|
74 | | -# context("asFactorSimpleDS::smk::done") |
| 57 | +context("asFactorSimpleDS::smk::done") |
0 commit comments