Running 'test.create_chunks.R' [174s]
  Running 'test.csv_rds_chunks.R' [2s]
  Running 'test.data_encode_decode.R' [166s]
  Running 'test.large_data_chunk.R' [5s]
  Running 'test.md5sum_chunks.R' [2s]
Running the tests in 'tests/test.create_chunks.R' failed.
Complete output:
  > # Use a temporary directory ----------------------------
  > owd = getwd()
  > td = tempdir()
  > setwd(td)
  > 
  > # Test --------------
  > library(knitrdata)
  > library(magrittr) # For pipe operator
  > 
  > # Create new Rmarkdown document
  > if (file.exists("test.create_chunks.Rmd"))
  +   file.remove("test.create_chunks.Rmd")
  > rmarkdown::draft("test.create_chunks.Rmd","github_document","rmarkdown",
  +                  edit=FALSE)
  > 
  > # List all chunks in document
  > chunklst = list_rmd_chunks(file="test.create_chunks.Rmd")
  > chunklst
    type    label start end
  1    r    setup     6   8
  2    r     cars    18  20
  3    r pressure    26  28
  > 
  > # Remove the pressure chunk
  > xx = split_rmd_by_chunk(file="test.create_chunks.Rmd",chunk_label="pressure")
  > txt = c(xx$pre_chunk,xx$post_chunk)
  > writeLines(txt,"test.create_chunks.Rmd")
  > 
  > # List chunks again
  > chunklst = list_rmd_chunks(file="test.create_chunks.Rmd")
  > chunklst
    type label start end
  1    r setup     6   8
  2    r  cars    18  20
  > 
  > # Remove all but setup chunk
  > remove_chunks(file="test.create_chunks.Rmd",
  +               chunk_labels = 2:nrow(chunklst),
  +               output.file="test.create_chunks.Rmd")
  > 
  > # List all chunks again
  > chunklst = list_rmd_chunks(file="test.create_chunks.Rmd")
  > chunklst
    type label start end
  1    r setup     6   8
  > 
  > # Create some binary data
  > x = data.frame(a=1:10,b=(1:10)^2)
  > saveRDS(x,"test.create_chunks.RDS")
  > 
  > # Push chunks into Rmarkdown document
  > # Insert in reverse order to not have to figure out line number
  > txt = create_chunk(chunk_label="plot",c("x","plot(b~a,data=x)"),chunk_type="r") %>%
  +   insert_chunk(11,rmd.file="test.create_chunks.Rmd")
  > txt = data_encode("test.create_chunks.RDS","base64") %>%
  +   create_chunk(chunk_label="thedata",output.var="x",format="binary",loader.function=readRDS) %>%
  +   insert_chunk(11,txt)
  > txt = create_chunk(chunk_label="loadknitrdata","library(knitrdata)",chunk_type="r") %>%
  +   insert_chunk(11,txt)
  > 
  > writeLines(txt,"test.create_chunks.Rmd")
  > 
  > # List all chunks again
  > chunklst = list_rmd_chunks(file="test.create_chunks.Rmd")
  > chunklst
    type         label start end
  1    r         setup     6   8
  2    r loadknitrdata    11  13
  3 data       thedata    14  20
  4    r          plot    21  24
  > 
  > # Render document to test
  > if (rmarkdown::pandoc_available(version="1.12.3"))
  +   rmarkdown::render("test.create_chunks.Rmd")
  
  
  processing file: test.create_chunks.Rmd
  output file: test.create_chunks.knit.md
  
  "C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS test.create_chunks.knit.md --to gfm+tex_math_dollars-yaml_metadata_block --from markdown+autolink_bare_uris+tex_math_single_backslash --output test.create_chunks.md --template "D:\RCompile\CRANpkg\lib\4.4\rmarkdown\rmarkdown\templates\github_document\resources\default.md" 
  "C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS test.create_chunks.md --to html4 --from gfm+tex_math_dollars --output test.create_chunks.html --embed-resources --standalone --highlight-style pygments --template "D:\RCompile\CRANpkg\lib\4.4\rmarkdown\rmarkdown\templates\github_document\resources\preview.html" --variable "github-markdown-css:D:\RCompile\CRANpkg\lib\4.4\rmarkdown\rmarkdown\templates\github_document\resources\github.css" --metadata pagetitle=PREVIEW --mathjax 
  
  Preview created: test.create_chunks.html
  
  Output created: test.create_chunks.md
  > 
  > # Clean up --------------
  > file.remove("test.create_chunks.Rmd","test.create_chunks.RDS",
  +             "test.create_chunks.md","test.create_chunks.html")
  [1] TRUE TRUE TRUE TRUE
  > unlink("test.create_chunks_files",recursive=TRUE)
  > 
  > setwd(owd)
  > 
  > proc.time()
     user  system elapsed 
     0.56    0.18    1.50 
Running the tests in 'tests/test.data_encode_decode.R' failed.
Complete output:
  > # Use a temporary directory ----------------------------
  > owd = getwd()
  > td = tempdir()
  > setwd(td)
  > 
  > # Do some data encoding and decoding ------------------
  > library(knitrdata)
  > 
  > x = data.frame(a=1:5,b=letters[1:5])
  > write.csv(x,"test.csv")
  > saveRDS(x,"test.RDS")
  > 
  > enccsv = data_encode("test.csv","base64")
  > encrds = data_encode("test.RDS","base64")
  > 
  > csv = data_decode(enccsv,"base64",as_text=TRUE)
  > cat(csv)
  "","a","b"
  "1",1,"a"
  "2",2,"b"
  "3",3,"c"
  "4",4,"d"
  "5",5,"e"
  > 
  > rds = data_decode(encrds,"base64",as_text=FALSE)
  > writeBin(rds,"test_output.RDS")
  > y = readRDS("test_output.RDS")
  > y
    a b
  1 1 a
  2 2 b
  3 3 c
  4 4 d
  5 5 e
  > 
  > params = list(run_gpg=FALSE)
  > if (requireNamespace("gpg") && params$run_gpg) {
  +   k = gpg::gpg_keygen("test","test@test.org")
  +   encgpg = data_encode("test.csv","gpg",options = list(receiver=k))
  + 
  +   cat(data_decode(encgpg,"gpg",as_text=TRUE))
  + 
  +   gpg::gpg_delete(k,secret=TRUE)
  + }
  Loading required namespace: gpg
  > 
  > # Cleanup ------------------------------------
  > file.remove("test.csv","test.RDS","test_output.RDS")
  [1] TRUE TRUE TRUE
  > 
  > setwd(owd)
  > 
  > proc.time()
     user  system elapsed 
     0.18    0.15    0.75