Skip to content

Commit 3ffc0f7

Browse files
committed
add test for edge case
1 parent f17a4da commit 3ffc0f7

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: PKPDmap
22
Type: Package
33
Title: MAP Bayesian estimates
4-
Version: 1.1.5
5-
Date: 2025-09-09
4+
Version: 1.1.6
5+
Date: 2025-09-10
66
Author: Ron Keizer, Jasmine Hughes, Kara Woo
77
Maintainer: Ron Keizer <ron@insight-rx.com>
88
Description: Obtain MAP Bayesian estimates based on individual data and

tests/testthat/test-parse_input_data.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ test_that("parse_input_data handles regular data frame input, with OBS_TYPE labe
1717

1818
})
1919

20+
test_that("parse_input_data picks right column, even with lower/uppercase duplicates", {
21+
data <- data.frame(
22+
T = c(1, 2, 3),
23+
obs_type = c(1, 0, 1),
24+
OBS_TYPE = c(2, 1, 1),
25+
Y = c(10, 20, 30)
26+
)
27+
result <- parse_input_data(data, obs_type_label = "OBS_TYPE")
28+
expect_equal(result$obs_type, c(2, 1, 1))
29+
expect_equal(sum(tolower(names(result)) == "obs_type"), 1)
30+
})
31+
2032
test_that("parse_input_data handles regular data frame input, with OBS_TYPE label, properly specified as `obs_type_label`", {
2133
# Create test data
2234
data <- data.frame(

0 commit comments

Comments
 (0)