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

Fail exception report is incorrect #152

Closed
ekrich opened this issue Jun 25, 2020 · 0 comments · Fixed by #427
Closed

Fail exception report is incorrect #152

ekrich opened this issue Jun 25, 2020 · 0 comments · Fixed by #427

Comments

@ekrich
Copy link

ekrich commented Jun 25, 2020

I get the following exception with the code that follows:
values are not equal even if they have the same toString(): bb as,dn

Longer version:

==> X org.scalajs.testsuite.javalib.util.PropertiesSuite.string leading  0.001s munit.FailException: /Users/eric/workspace/portable-scala-java-test/testSuite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/PropertiesSuite.scala:162 values are not equal even if they have the same `toString()`: bb as,dn
161:    println(s"'$b'=='$res1' ${b==res1}")
162:    assertEquals(b, res1)
163:  }

Here are the tests:

val b = "bb as,dn"
  test("string trailing"){
    val res0 = "bb as,dn   "
    println(s"'$res0'=='$b' ${res0==b}")
    assertEquals(res0, b)
  }

  test("string leading") {
    val res1 = "   bb as,dn"
    println(s"'$b'=='$res1' ${b==res1}")
    assertEquals(b, res1)
  }
raboof added a commit to raboof/munit that referenced this issue Oct 5, 2021
The current logic may claim values have the same `toString()`
when they don't. The 'full' solution would of course be to
have a 'strict' string diff, but until then let's at least
not lie about it.

Fixes scalameta#152
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

Successfully merging a pull request may close this issue.

1 participant