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

flakey test: X cats.parse.ParserTest.a.flatMap(b) composes as expected parser00 #395

Open
johnynek opened this issue Mar 27, 2022 · 0 comments

Comments

@johnynek
Copy link
Collaborator

I think this is a case of the flatMap optimization exposing a better error message (flatMap where the left is a known value is the same as a product).

==> X cats.parse.ParserTest.a.flatMap(b) composes as expected parser00  0.218s munit.ComparisonFailException: /home/runner/work/cats-parse/cats-parse/core/shared/src/test/scala/cats/parse/ParserTest.scala:1131
[318](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:318)
1130:
[319](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:319)
1131:        assertEquals(indirect, directResult)
[320](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:320)
1132:      }
[321](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:321)
values are not the same
[322](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:322)
=> Obtained
[323](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:323)
Left(
[324](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:324)
  value = Error(
[325](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:325)
    failedAtOffset = 0,
[326](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:326)
    expected = NonEmptyList(
[327](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:327)
      head = OneOfStr(
[328](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:328)
        offset = 0,
[329](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:329)
        strs = List(
[330](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:330)
          " s(\\).YYZ"
[331](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:331)
        )
[332](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:332)
      ),
[333](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:333)
      tail = List(
[334](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:334)
        InRange(
[335](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:335)
          offset = 0,
[336](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:336)
          lower = '\u0000',
[337](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:337)
          upper = '\uffff'
[338](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:338)
        )
[339](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:339)
      )
[340](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:340)
    )
[341](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:341)
  )
[342](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:342)
)
[343](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:343)
=> Diff (- obtained, + expected)
[344](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:344)
     expected = NonEmptyList(
[345](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:345)
-      head = OneOfStr(
[346](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:346)
+      head = InRange(
[347](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:347)
         offset = 0,
[348](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:348)
-        strs = List(
[349](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:349)
-          " s(\\).YYZ"
[350](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:350)
-        )
[351](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:351)
+        lower = '\u0000',
[352](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:352)
+        upper = '\uffff'
[353](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:353)
       ),
[354](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:354)
-      tail = List(
[355](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:355)
-        InRange(
[356](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:356)
-          offset = 0,
[357](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:357)
-          lower = '\u0000',
[358](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:358)
-          upper = '\uffff'
[359](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:359)
-        )
[360](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:360)
-      )
[361](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:361)
+      tail = Nil
[362](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:362)
     )
[363](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:363)

[364](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:364)
Failing seed: w7VthRO-iPVJWFY3rXtWzH4b3xVthbeUio5nWNQeoUA=
[365](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:365)
You can reproduce this failure by adding the following override to your suite:
[366](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:366)

[367](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:367)
  override val scalaCheckInitialSeed = "w7VthRO-iPVJWFY3rXtWzH4b3xVthbeUio5nWNQeoUA="
[368](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:368)

[369](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:369)
Falsified after 1104 passed tests.
[370](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:370)
> ARG_0: GenT(OneOf(List(Map(Void(AnyChar),<function1>), Map(Str( s(\).YYZ),<function1>))))
[371](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:371)
> ARG_1: ""
[372](https://github.com/typelevel/cats-parse/runs/5614705985?check_suite_focus=true#step:7:372)
> ARG_2: org.scalacheck.GenArities$$Lambda$11873/1560244765@4d07dfbe
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