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 #698

Open
epifab opened this issue Sep 15, 2023 · 2 comments
Open

Hanging test with scalacheck using asciiStr #698

epifab opened this issue Sep 15, 2023 · 2 comments

Comments

@epifab
Copy link

epifab commented Sep 15, 2023

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

@epifab epifab changed the title Hanging test with scalacheck asciiStr Hanging test with scalacheck using asciiStr Sep 15, 2023
@epifab
Copy link
Author

epifab commented Sep 18, 2023

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

@dabd
Copy link
Contributor

dabd commented Nov 21, 2023

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

2 participants