Skip to content

Fix compatibility with the upcoming version of testthat #41

Closed
@Enchufa2

Description

@Enchufa2
1 error  | 0 warnings | 0 notes.

    checking tests ... ERROR
    Running the tests in ‘tests/testthat.R’ failed.
    Last 13 lines of output:
      > test_check("simmer")
      1. Failure: the trajectory stores the right number of activities
(@test-trajectory.R#76)
      `output` does not match ".*(13
activities.*Seize.*nurse.*1.*Timeout.*function.*Release.*nurse.*1.*Branch.*1.*6
activities.*Seize.*doctor.*function.*Timeout.*function.*Release.*doctor.*function.*Branch.*1.*3
activities.*Seize.*administration.*1.*Timeout.*1.*Release.*administration.*1.*Rollback.*1.*Branch.*1.*Rollback.*1.*Rollback.*function.*SetAttribute.*1.*SetAttribute.*function).*".
      Actual value: ""


      Trajectory: anonymous, 1 activities
      testthat results
================================================================
      OK: 192 SKIPPED: 0 FAILED: 1
      1. Failure: the trajectory stores the right number of activities
(@test-trajectory.R#76)

      Error: testthat unit tests failed
      Execution halted

There are two common classes of
new failures caused by this version of testthat:

  1. expect_output() no longer automatically prints the object. You'll need to
    explicitly print() if you want to check the output of a print method.
  2. expect_error() now only compares against the actual error message,
    not the prefix, e.g. "Error in foo(): ". You might need to change you
    match message to take this into account.

It seems the problem falls into category 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions