File: test-bench_process_memory.R

package info (click to toggle)
r-cran-bench 1.1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 712 kB
  • sloc: ansic: 339; sh: 13; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 600 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
describe("bench_process_memory", {
  it("has a current and max memory of bench bytes", {
    res <- bench_process_memory()
    expect_named(res, c("current", "max"))
    expect_s3_class(res[["current"]], "bench_bytes")
    expect_s3_class(res[["max"]], "bench_bytes")
  })

  # This test is unreliable due to when gcs happen when run repeatedly, so it
  # is commented out.
  #it("current memory increases when you allocate a medium size vector", {
  #res1 <- bench_process_memory()
  #x <- rep(1, 1e8)
  #res2 <- bench_process_memory()
  #expect_true(res2[["current"]] > res1[["current"]])
  #})
})