Ad
  • Custom User Avatar

    I think I did this? If you still see sample tests with code not compatible with Scala 3, then click the RESET button in the trainer to get the latest version (back up your solution first, because it wil also get reset).
    If you think there's still some problem with tests, let me know.

  • Default User Avatar

    Approved. Thanks!

  • Custom User Avatar
  • Default User Avatar

    That bothered me too but an experience can be thought as valid when this experience can be repeated some numbers of times though I must agree that I don't have your wisdom.

  • Custom User Avatar

    This problem in ScalaTest is indeed very annoying, and not very widely known. It always annoys me that I need to remember about it when writing Scala tests, and I wonder if it could be avoided or made clearer. But what actually bothers me (a bit) is how quickly a valid issue got closed without fixing because "works for me". 605 other Scala users were just lucky.

  • Default User Avatar

    @Unnamed: thanks!
    @hobovsky: I am not the Scala translator who, unfortunately, has left CW. The probability to have several identical name is small but certainly not null:-(

  • Default User Avatar

    The random tests generate test names (it("<name>")) dynamically. When there are multiple identical names, this is probably when this error appears.

  • Custom User Avatar

    Well, I think you just resolved a valid issue without fixing.

    Theres a special attention needed when writing tests for Scala, and the error is most probably caused by incorrect setup of tests.

    I cannot check atm, but I will verify when I'm back home and submit a fix or reraise the issue if necessary.

  • Default User Avatar

    I tried several solutions and all worked fine.
    I also tried your solution. I didn't get what is in your post but

    Examples should return false if one of the sequences is null.
    Test Failed
    java.lang.NullPointerException was thrown.
    

    Sorry, I don't understand why you got

    org.scalatest.exceptions.DuplicateTestNameException was thrown inside describe("Random tests:"), 
    construction cannot continue: "Duplicate test name: Random tests: should return false for (Vector(71), Vector(5042))"