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

Hanging test with scalacheck using asciiStr #83

Open
zainab-ali opened this issue Nov 7, 2024 · 2 comments
Open

Hanging test with scalacheck using asciiStr #83

zainab-ali opened this issue Nov 7, 2024 · 2 comments

Comments

@zainab-ali
Copy link
Contributor

This issue was copied over from: disneystreaming/weaver-test#698
It was opened by: epifab


This could probably be replicated without using scalacheck, my theory is that it blows up the DiffUtils with some non-printable characters.

import org.scalacheck.{Arbitrary, Gen}
import weaver.scalacheck.*
import weaver.SimpleIOSuite

object NonTerminatingSuite extends SimpleIOSuite with Checkers:
  test("Fix me") {
    given Arbitrary[String] = Arbitrary(Gen.asciiStr)
    forall: (s: String) =>
      expect.same("", s)
  }

scala 3.3.0
weaver 0.8.3

@zainab-ali
Copy link
Contributor Author

This comment was copied over from: disneystreaming/weaver-test#698 (comment)
It was written by: epifab


to give a little more context, switching from asciiStr to printableAsciiStr fixes the issue

@zainab-ali
Copy link
Contributor Author

This comment was copied over from: disneystreaming/weaver-test#698 (comment)
It was written by: dabd


The issue comes from the way expecty DiffUtil tokenizes an Escape control character (Char with Int value 27).
I have a fix in the works but I am not sure it will break the intention of this tokenization function, which is not well documented and actually is a copy-paste from dotty.

Minimal repro:

  pureTest("Fix me") {
    val s = 27.toChar.toString
    expect.same("", s)
  }

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

No branches or pull requests

1 participant