Skip to content

Commit 8294b85

Browse files
committed
Remove early return in example
1 parent 5d8887d commit 8294b85

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

vignettes/custom-expectation.Rmd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,18 @@ expect_vector_length <- function(object, n) {
157157
sprintf("Expected %s to be a vector", act$lab),
158158
sprintf("Actual type: %s", typeof(act$val))
159159
))
160-
return(invisible(act$val))
161-
}
162-
163-
act_n <- length(act$val)
164-
if (act_n != n) {
165-
fail(c(
166-
sprintf("Expected %s to have length %i.", act$lab, n),
167-
sprintf("Actual length: %i.", act_n)
168-
))
169160
} else {
170-
pass()
161+
act_n <- length(act$val)
162+
if (act_n != n) {
163+
fail(c(
164+
sprintf("Expected %s to have length %i.", act$lab, n),
165+
sprintf("Actual length: %i.", act_n)
166+
))
167+
} else {
168+
pass()
169+
}
171170
}
171+
172172
invisible(act$val)
173173
}
174174
```

0 commit comments

Comments
 (0)