GetShopTV / swagger2

Swagger 2.0 data model.
http://hackage.haskell.org/package/swagger2
BSD 3-Clause "New" or "Revised" License
74 stars 59 forks source link

Tests fail on GHC 9.8 with allow-newer #248

Closed ysangkok closed 8 months ago

ysangkok commented 11 months ago
cabal test -w ghc-9.8.1 \
  --allow-newer=swagger2:hspec,swagger2:aeson\
  --allow-newer=swagger2:base,swagger2:template-haskell\
  --allow-newer=swagger2:bytestring,swagger2:text
Failures:

  test/Data/Swagger/SchemaSpec.hs:33:22: 
  1) Data.Swagger.Schema, Generic ToSchema, Schema name, (Int, Float), schema name is Nothing
       expected: Nothing
        but got: Just "Tuple2"

  To rerun use: --match "/Data.Swagger.Schema/Generic ToSchema/Schema name/(Int, Float)/schema name is Nothing/" --seed 1777496697

  test/Data/Swagger/SchemaSpec.hs:38:29: 
  2) Data.Swagger.Schema, Generic Definitions, [Set (Unit, Maybe Color)], uses these definitions ["Unit","Color"]
       expected: ["Unit", "Color"]
        but got: ["Tuple2", "Unit", "Color"]

  To rerun use: --match "/Data.Swagger.Schema/Generic Definitions/[Set (Unit, Maybe Color)]/uses these definitions [\"Unit\",\"Color\"]/" --seed 1777496697

Randomized with seed 1777496697

Finished in 1.1996 seconds
361 examples, 2 failures

Test suite spec: FAIL
ysangkok commented 11 months ago

@swamp-agr Do you know why this test fails? I am not familiar with this code.

swamp-agr commented 9 months ago

I believe, it comes from the way new GHC/base are treating tuples, i.e. with explicit constructors. Sooner we will see more things like Tuple2 a b instead of (a, b), Tuple3 a b c instead of (a, b, c) and so on. Same goes for list, I think.

swamp-agr commented 9 months ago

As it was explained to me, it should not be user-facing change. Anyway, it happened this way. That's why I cannot find anything about it in changelogs of GHC 9.8.1, base 4.19.0.0.

More details could be found here: https://github.com/ghc-proposals/ghc-proposals/pull/475

swamp-agr commented 8 months ago

GHC documentation issue: https://gitlab.haskell.org/ghc/ghc/-/issues/24291