fpco / inline-c

284 stars 50 forks source link

inline-c-0.6.0.5 test suite failure #72

Closed peti closed 5 years ago

peti commented 6 years ago

Citing from https://hydra.nixos.org/build/70893577:

Running 1 test suites...
Test suite tests: RUNNING...

Language.C.Types.Parse
  parses everything which is pretty-printable (C)
  parses everything which is pretty-printable (Haskell) FAILED [1]
Language.C.Inline.Context
  converts simple type correctly (1)
  converts simple type correctly (2)
  converts void
  converts standard library types (1)
  converts standard library types (2)
  converts standard library types (3)
  converts single ptr type
  converts double ptr type
  converts arrays
  converts named things
  converts arrays of pointers
  ignores qualifiers
  ignores storage information
  converts sized arrays
  converts variably sized arrays
  converts function pointers
  converts complicated function pointers (1)
  converts complicated function pointerst (2)
  converts complicated function pointers (3)
Language.C.Inline.Parse
  parsing
    parses simple C expression
    accepts anti quotes
    rejects if bad braces (1)
    rejects if bad braces (2)
    parses function pointers
    parses returning function pointers
    parses Haskell identifier (1)
    parses Haskell identifier (2)
    parses Haskell identifier (3)
    does not parse Haskell identifier in bad position
TH integration
  inlineCode
  inlineItems
  inlineExp
  inlineCode
  exp
  pure
  unsafe exp
  interruptible exp
  void exp
  Foreign.C.Types library types
  stdint.h types
  foreign pointer argument
  function pointer argument
  function pointer result
  quick function pointer argument
  function pointer argument (pure)
  quick function pointer argument (pure)
  test mkFunPtrFromName
  vectors
  quick vectors
  bytestrings
  Haskell identifiers

Failures:

  test/Language/C/Types/ParseSpec.hs:43: 
  1) Language.C.Types.Parse parses everything which is pretty-printable (Haskell)
       uncaught exception: ErrorCall (HaskellIdentifier fromString: invalid string AjN.I.if:
       "haskellIdentifierFromString" (line 1, column 9):
       unexpected reserved Haskell identifier "if"
       expecting lowercase letter, "_", uppercase letter, digit or "'"
       CallStack (from HasCallStack):
         error, called at src/Language/C/Inline/HaskellIdentifier.hs:48:19 in inline-c-0.6.0.5-8WaOsbm2SUrB16izCzzXp3:Language.C.Inline.HaskellIdentifier) (after 21 tests)
       *** Failed! (after 21 tests): 
       Exception:
         HaskellIdentifier fromString: invalid string AjN.I.if:
         "haskellIdentifierFromString" (line 1, column 9):
         unexpected reserved Haskell identifier "if"
         expecting lowercase letter, "_", uppercase letter, digit or "'"
         CallStack (from HasCallStack):
           error, called at src/Language/C/Inline/HaskellIdentifier.hs:48:19 in inline-c-0.6.0.5-8WaOsbm2SUrB16izCzzXp3:Language.C.Inline.HaskellIdentifier

Randomized with seed 1164776840

Finished in 1.2695 seconds
53 examples, 1 failure
Hello
Test suite tests: FAIL
bitonic commented 5 years ago

i coudn't reproduce with stack test --ta '--seed=1164776840' inline-c on 8bae45eb7c308023965a6f069170b31b1acf4321. the code that generates haskell identifiers should prevent this: https://github.com/fpco/inline-c/blob/8bae45eb7c308023965a6f069170b31b1acf4321/inline-c/test/Language/C/Types/ParseSpec.hs#L250 .