Skip to content

Commit

Permalink
Fix testsuite warnings (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorki authored Nov 15, 2023
1 parent 59cbeff commit d4200e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions test/Test.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where

import TestUtils
Expand Down Expand Up @@ -30,7 +31,8 @@ debug = False
{-# SPECIALIZE testCoercion :: (Float, Word32) -> IO () #-}
{-# SPECIALIZE testCoercion :: (Double, Word64) -> IO () #-}
testCoercion
:: ( Show f
:: forall f w m
. ( Show f
, Show w
, Integral w
, RealFloat f
Expand All @@ -40,9 +42,9 @@ testCoercion
=> (f, w)
-> m ()
testCoercion (f, w) = do
let w' = coerceToWord f
f' = coerceToFloat w
w'' = coerceToWord f'
let w' = (coerceToWord :: f -> w) f
f' = (coerceToFloat :: w -> f) w
w'' = (coerceToWord :: f -> w) f'
unless (w' == w) $ failTest (show f) (showW w) (showW w')
unless (f' `eqFloat` f) $ failTest (showW w) (show f) (show f')
unless (w'' == w) $ failTest (show f') (showW w) (showW w'')
Expand Down
1 change: 0 additions & 1 deletion test/TestUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
module TestUtils where

import Data.Word
import Data.Bits

import Numeric

Expand Down

0 comments on commit d4200e0

Please sign in to comment.