Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method checkpoint to trait Checkpoints for easy use of Checkpoint #2305

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ndy2
Copy link

@ndy2 ndy2 commented Jan 1, 2024

I added a method checkpoint to trait Checkpoints for easy use of Checkpoint.

I have some experience of other test frameworks of JVM familiy like Junit/assertj & kotest.
I thought that create Checkpoint & report it is quite verbose and tedious.

Thus, I introduce a checkpoint!
I found that like the trait Checkpoint is right place to place this method like other dsl helper traits in scalatest. (Inside, Matchers ...)

Full Usage Example :

class FourBasicOperationSpec extends AnyFlatSpec with Matchers with Checkpoints {

  it("four basic operation") {
    checkpoint { cp =>
      cp { 1 + 1 should equal(2) }
      cp { 2 + 2 should equal(4) }
    }

    checkpoint { cp =>
      cp { 1 - 1 should equal(0) }
      cp { 2 - 2 should equal(0) }
    }

   ...
  }
}

Inspired by

Copy link

cla-bot bot commented Jan 1, 2024

Hi @ndy2, we require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please access https://www.artima.com/cla/choose-type to sign our Contributor License Agreement. Your effort is highly appreciated. Thank you.

@artimasites
Copy link

@cla-bot[bot] check

@cla-bot cla-bot bot added the cla-signed label Jan 1, 2024
Copy link

cla-bot bot commented Jan 1, 2024

The cla-bot has been summoned, and re-checked this pull request!

@ndy2 ndy2 changed the base branch from main to 3.2.x-new January 4, 2024 14:18
@ndy2 ndy2 changed the base branch from 3.2.x-new to main January 4, 2024 14:19
@ndy2
Copy link
Author

ndy2 commented Jan 5, 2024

Hello, @cheeseng !
I have no idea why the compilation fail in scala 2.13,2.11, 3, js even the unit tests are all passed.
Can you give me some suggestion or comment on this PR?

@cheeseng
Copy link
Contributor

@ndy2 Sorry for the late response, I'll take a look today and what's going on.

Cheers.

@cheeseng
Copy link
Contributor

@ndy2 I managed to fix the compile errors:

cheeseng@4d2fcc5

But the unit tests are failing because of wrong line number check, I'll try to look into it further when possible.

@cheeseng
Copy link
Contributor

@ndy2 I managed to fix the problem, I submitted the following PR to your fork:

ndy2#1

Hopefully after merging it should get your PR pass the CI here.

Cheers.

@ndy2
Copy link
Author

ndy2 commented Feb 13, 2024

I merged the PR in my fork.
Can I get approval for check the CI pass?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants