Skip to content

Commit 0d4f5fd

Browse files
committed
fix broken tests
- struct::struct_class now correctly checks for bibtex format of citations - fixed incorrect use of testthat::expect_output when testing ontology classes
1 parent 49d92fc commit 0d4f5fd

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: struct
22
Type: Package
33
Title: Statistics in R Using Class-based Templates
4-
Version: 1.20.0
4+
Version: 1.20.1
55
Authors@R: c(
66
person(
77
c("Gavin","Rhys"),

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Changes 1.20.1
2+
+ fix broken tests
3+
14
Changes 1.15.5
25
+ update automated documentation generation
36

R/struct_class.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ struct_class = function(
7777
}
7878

7979
# check all citations are Bibtex
80-
if (length(citations>0)) {
81-
ok=unlist(lapply(citations,is,class='bibentry'))
82-
if (!(all(ok))){
83-
stop('all citations must be in "bibentry" format')
84-
}
85-
}
80+
#if (length(citations>0)) {
81+
# ok=unlist(lapply(citations,is,class='bibentry'))
82+
# if (!(all(ok))){
83+
# stop('all citations must be in "bibentry" format')
84+
# }
85+
#}
8686

8787
# new object
8888
out = .struct_class(
@@ -123,7 +123,7 @@ setValidity('struct_class', method = function(object) {
123123

124124
citations=object$citations
125125
# check all citations are Bibtex
126-
if (length(citations>0)) {
126+
if (length(citations)>0) {
127127
ok=unlist(lapply(citations,is,class='bibentry'))
128128
if (!(all(ok))){
129129
str=c(str,('All citations must be in "bibentry" format'))

tests/testthat/test-ontology.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test_that('ontology works as expected',{
4747

4848
expect_error(O$cake)
4949

50-
expect_output(show(O[1]),"STATO:0000555",regexp = 'STATO:0000555')
50+
expect_output(show(O[1]),regexp = 'STATO:0000555')
5151

5252
O=ontology_list()
5353
expect_equal(length(O),0)

0 commit comments

Comments
 (0)