Skip to content

Commit

Permalink
fix test for openssl bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mllg committed Mar 11, 2018
1 parent d416691 commit 0be3779
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/helper.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
library(testthat)
library(checkmate)

rand = function(n, min = 1L, max = 32L, only.ascii = FALSE) {
rand = function(n, min = 5L, max = 50L, only.ascii = FALSE) {
chars = c(letters, LETTERS, c("=", "+", "-", "_", "/", "&", "=", "?", ":", ".", "%"))
if (!isTRUE(only.ascii))
chars = c(chars, "ö", "`", "\n")
chars = c(chars, "ö", "`", "\n", "")
replicate(n, paste0(sample(chars, sample(min:max, 1L), replace = TRUE), collapse = ""))
}
4 changes: 3 additions & 1 deletion tests/testthat/test_base64.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ test_that("comparison with base64enc", {

test_that("comparison with openssl", {
for (i in 1:10) {
plain = rand(1000, only.ascii = FALSE)
# openssl seems to have problems with the encoding on windows :/
# openssl <-> openssl is not working!
plain = rand(1000, only.ascii = testOS("windows"))
enc_openssl = base64enc_openssl(plain)
enc_url = base64_urlencode(plain)

Expand Down

0 comments on commit 0be3779

Please sign in to comment.