Skip to content

Commit 434de24

Browse files
author
Mar Gonzalez-Porta
committed
updated tests
1 parent 3c43da8 commit 434de24

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

tests/testthat/test_input.R

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ test_that("read_samplesheet_ loads data with no errors and returns the expected
4747

4848
s <- happy_samplesheet$samplesheet
4949
expect_is(s, "data.frame")
50-
expect_equal(dim(s)[1], 4)
51-
expect_equal(dim(s)[2], 5)
50+
expect_equal(dim(s)[1], 4) # 4 rows
51+
expect_equal(dim(s)[2], 3) # 3 columns
5252

5353
r <- happy_samplesheet$results
5454
expect_is(r, "happy_result_list")
@@ -57,30 +57,26 @@ test_that("read_samplesheet_ loads data with no errors and returns the expected
5757
expect_is(r[[1]], "happy_result")
5858
expect_true(all(names(r[[1]]) %in% c("summary", "extended", "pr_curve")))
5959

60-
e <- happyR::extract_results(r, table = "summary")
60+
e <- extract_results(r, table = "summary")
6161
expect_is(e, "data.frame")
6262
expect_equal(dim(e)[1], 16)
6363
expect_equal(dim(e)[2], 18)
64-
expect_true("from" %in% colnames(e))
64+
expect_true("happy_prefix" %in% colnames(e))
6565

66-
e <- happyR::extract_results(r, table = "extended")
66+
e <- extract_results(r, table = "extended")
6767
expect_is(e, "data.frame")
6868
expect_equal(dim(e)[1], 704)
6969
expect_equal(dim(e)[2], 66)
70-
expect_true("from" %in% colnames(e))
70+
expect_true("happy_prefix" %in% colnames(e))
7171

7272
p <- r[[1]]$pr_curve
7373
expect_is(p, "environment")
7474
expect_true(all(names(p) %in% c("INDEL_SEL", "INDEL_PASS", "INDEL", "all")))
7575

76-
e <- happyR::extract_results(r, table = "pr.indel.pass")
76+
e <- extract_results(r, table = "pr.indel.pass")
7777
expect_is(e, "data.frame")
7878
expect_equal(dim(e)[1], 9126)
7979
expect_equal(dim(e)[2], 67)
80-
expect_true("from" %in% colnames(e))
81-
82-
expect_is(b[[1]], "data.frame")
83-
expect_equal(dim(b[[1]])[1], 1)
84-
expect_equal(dim(b[[1]])[2], 136)
80+
expect_true("happy_prefix" %in% colnames(e))
8581

8682
})

0 commit comments

Comments
 (0)