Fix ambigious Int resolution in the lexer tests

This commit is contained in:
Eugen Wissner 2019-06-26 15:41:30 +02:00
parent 2172de3729
commit 3cc38343db
3 changed files with 16 additions and 6 deletions

12
stack.yaml.lock Normal file
View File

@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files
packages: []
snapshots:
- completed:
size: 499889
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/13/26.yaml
sha256: ecb02ee16829df8d7219e7d7fe6c310819820bf335b0b9534bce84d3ea896684
original: lts-13.26

View File

@ -6,7 +6,6 @@ module Language.GraphQL.LexerTest
, reference
) where
import Control.Applicative (Alternative(..))
import Language.GraphQL.Lexer
import qualified Data.Text as T
import Data.Void (Void)
@ -58,11 +57,11 @@ reference = testGroup "Lexer"
"""|] @?= Right "spans\n multiple\n lines"
, testCase "lexes numbers" $ do
runParser integer "4" @?= Right 4
runParser integer "4" @?= Right (4 :: Int)
runParser float "4.123" @?= Right 4.123
runParser integer "-4" @?= Right (-4)
runParser integer "9" @?= Right 9
runParser integer "0" @?= Right 0
runParser integer "-4" @?= Right (-4 :: Int)
runParser integer "9" @?= Right (9 :: Int)
runParser integer "0" @?= Right (0 :: Int)
runParser float "-4.123" @?= Right (-4.123)
runParser float "0.123" @?= Right 0.123
runParser float "123e4" @?= Right 123e4

View File

@ -1,6 +1,5 @@
module Main where
import Control.Monad.IO.Class (liftIO)
import qualified Data.GraphQL.Encoder as Encoder
import qualified Language.GraphQL.LexerTest as LexerTest
import qualified Data.GraphQL.Parser as Parser