genericToFromJSON: _UFoo: [Failed] in current git tree #44

Closed
markwright opened this Issue Nov 18, 2011 · 6 comments

3 participants

@markwright

With ghc 7.0.4 linux amd64, test genericToFromJSON: _UFoo: [Failed] in current git tree:

argus tests # ./qc
encode:
encodeDouble: [OK, passed 100 tests]
encodeInteger: [OK, passed 100 tests]
genericFrom:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
genericTo:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
roundTrip:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Integer: [OK, passed 100 tests]
String: [OK, passed 100 tests]
Text: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
toFromJSON:
Integer: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Maybe Integer: [OK, passed 100 tests]
Either Integer Double: [OK, passed 100 tests]

Either Integer Integer: [OK, passed 100 tests]
genericToFromJSON:
_UFoo: [Failed]
Falsifiable with seed 5308406286099367168, after 1 tests. Reason: Falsifiable

     Properties   Total       

Passed 22 22

Failed 1 1

Total 23 23

argus tests # ./qc
encode:
encodeDouble: [OK, passed 100 tests]
encodeInteger: [OK, passed 100 tests]
genericFrom:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
genericTo:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
roundTrip:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Integer: [OK, passed 100 tests]
String: [OK, passed 100 tests]
Text: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
toFromJSON:
Integer: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Maybe Integer: [OK, passed 100 tests]
Either Integer Double: [OK, passed 100 tests]

Either Integer Integer: [OK, passed 100 tests]
genericToFromJSON:
_UFoo: [Failed]
Falsifiable with seed 8620178254206185358, after 1 tests. Reason: Falsifiable

     Properties   Total       

Passed 22 22

Failed 1 1

Total 23 23

argus tests # ./qc
encode:
encodeDouble: [OK, passed 100 tests]
encodeInteger: [OK, passed 100 tests]
genericFrom:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
genericTo:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
roundTrip:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Integer: [OK, passed 100 tests]
String: [OK, passed 100 tests]
Text: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
toFromJSON:
Integer: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Maybe Integer: [OK, passed 100 tests]
Either Integer Double: [OK, passed 100 tests]
UFoo {_UFooInt = -1, uFooInt = -1}

Either Integer Integer: [OK, passed 100 tests]
genericToFromJSON:
_UFoo: [Failed]
Falsifiable with seed 1349346501665683387, after 1 tests. Reason: Falsifiable

     Properties   Total       

Passed 22 22

Failed 1 1

Total 23 23

argus tests # ./qc
encode:
encodeDouble: [OK, passed 100 tests]
encodeInteger: [OK, passed 100 tests]
genericFrom:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
genericTo:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
roundTrip:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Integer: [OK, passed 100 tests]
String: [OK, passed 100 tests]
Text: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
toFromJSON:
Integer: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Maybe Integer: [OK, passed 100 tests]
Either Integer Double: [OK, passed 100 tests]

Either Integer Integer: [OK, passed 100 tests]
genericToFromJSON:
_UFoo: [Failed]
Falsifiable with seed 5534180966496665992, after 1 tests. Reason: Falsifiable

     Properties   Total       

Passed 22 22

Failed 1 1

Total 23 23

argus tests #

@basvandijk
Collaborator

All tests pass in the latest git tree so I guess this can be closed.

@markwright

Thanks, I just tested it again with the latest git tree, it still fails for me with both ghc 7.2.2 and 7.0.4:

argus tests # ./qc
encode:
encodeDouble: [OK, passed 100 tests]
encodeInteger: [OK, passed 100 tests]
genericFrom:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
genericTo:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
roundTrip:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Integer: [OK, passed 100 tests]
String: [OK, passed 100 tests]
Text: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
toFromJSON:
Integer: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Maybe Integer: [OK, passed 100 tests]
Either Integer Double: [OK, passed 100 tests]

Either Integer Integer: [OK, passed 100 tests]
genericToFromJSON:
_UFoo: [Failed]
Falsifiable with seed -2940867480968594345, after 1 tests. Reason: Falsifiable

     Properties   Total       

Passed 22 22

Failed 1 1

Total 23 23

argus tests # env | egrep '(LANG|LC)'
argus tests #

I don't have any locale environments set, I wonder if that matters. My tests are on gentoo amd64.

@basvandijk
Collaborator

Weird, are you sure you're using an up to date repository? What's the output when you run these commands:

$ git clone git://github.com/bos/aeson.git
...
$ cd aeson
$ cabal configure --enable-tests
...
$ cabal build
...
$ cabal test
Running 1 test suites...
Test suite tests: RUNNING...
Test suite tests: PASS
Test suite logged to: dist/test/aeson-0.4.0.0-tests.log
1 of 1 test suites (1 of 1 test cases) passed.
@markwright

Hi, thanks for looking at this! The cabal test works, and the tests/qc has a test that fails:

argus% git clone git://github.com/bos/aeson.git

Cloning into 'aeson'...
remote: Counting objects: 1328, done.
remote: Compressing objects: 100% (620/620), done.
remote: Total 1328 (delta 747), reused 1257 (delta 679)
Receiving objects: 100% (1328/1328), 285.12 KiB | 48 KiB/s, done.
Resolving deltas: 100% (747/747), done.
argus% cd aeson
argus% cabal configure --enable-tests
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
Resolving dependencies...
Configuring aeson-0.4.0.0...
argus% cabal build
Preprocessing library aeson-0.4.0.0...
Preprocessing test suites for aeson-0.4.0.0...
Building aeson-0.4.0.0...
[1 of 9] Compiling Data.Aeson.Types.Internal ( Data/Aeson/Types/Internal.hs, dist/build/Data/Aeson/Types/Internal.o )
[2 of 9] Compiling Data.Aeson.Functions ( Data/Aeson/Functions.hs, dist/build/Data/Aeson/Functions.o )
[3 of 9] Compiling Data.Aeson.Types.Class ( Data/Aeson/Types/Class.hs, dist/build/Data/Aeson/Types/Class.o )
[4 of 9] Compiling Data.Aeson.Types ( Data/Aeson/Types.hs, dist/build/Data/Aeson/Types.o )
[5 of 9] Compiling Data.Aeson.Generic ( Data/Aeson/Generic.hs, dist/build/Data/Aeson/Generic.o )
[6 of 9] Compiling Data.Aeson.Parser ( Data/Aeson/Parser.hs, dist/build/Data/Aeson/Parser.o )
[7 of 9] Compiling Data.Aeson.Encode ( Data/Aeson/Encode.hs, dist/build/Data/Aeson/Encode.o )
[8 of 9] Compiling Data.Aeson ( Data/Aeson.hs, dist/build/Data/Aeson.o )
[9 of 9] Compiling Data.Aeson.TH ( Data/Aeson/TH.hs, dist/build/Data/Aeson/TH.o )
Registering aeson-0.4.0.0...
[1 of 1] Compiling Main ( tests/Properties.hs, dist/build/tests/tests-tmp/Main.o )
Linking dist/build/tests/tests ...
argus% cabal test
Running 1 test suites...
Test suite tests: RUNNING...
Test suite tests: PASS
Test suite logged to: dist/test/aeson-0.4.0.0-tests.log
1 of 1 test suites (1 of 1 test cases) passed.
argus% cd tests
argus% sed -e 's@:= ghc@:= ghc -hide-package aeson-native -hide-package HTF@' -i Makefile
argus% make
ghc -hide-package aeson-native -hide-package HTF -Wall -o -threaded --make qc Properties.hs
[1 of 1] Compiling Main ( Properties.hs, Properties.o )
Linking qc ...
argus% ./qc
encode:
encodeDouble: [OK, passed 100 tests]
encodeInteger: [OK, passed 100 tests]
genericFrom:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
genericTo:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
roundTrip:
Bool: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Int: [OK, passed 100 tests]
Integer: [OK, passed 100 tests]
String: [OK, passed 100 tests]
Text: [OK, passed 100 tests]
Foo: [OK, passed 100 tests]
toFromJSON:
Integer: [OK, passed 100 tests]
Double: [OK, passed 100 tests]
Maybe Integer: [OK, passed 100 tests]
Either Integer Double: [OK, passed 100 tests]

Either Integer Integer: [OK, passed 100 tests]
genericToFromJSON:
_UFoo: [Failed]
Falsifiable with seed -4261607414197767780, after 1 tests. Reason: Falsifiable

     Properties   Total       

Passed 22 22

Failed 1 1

Total 23 23

argus%

@basvandijk
Collaborator

Do note that when you build the tests using the Makefile you need to cabal install the package first. According to the log you posted, you don't seem to do this. So I expect you're using an already installed aeson which has the bug.

@bos
Owner

I just pushed a change that removes the Makefile, so this should no longer be possible. Thanks!

@bos bos closed this Nov 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment