@@ -16,7 +16,7 @@ import Text.Show.Functions ()
1616import Control.Arrow ((***), second)
1717import Control.Exception (catch)
1818import Data.Char (chr, isDigit, isHexDigit, isLower, isSpace, isUpper, ord)
19−import Data.Int (Int8)
19+import Data.Int (Int8, Int16, Int32, Int64)
2020import Data.Monoid (Monoid(..))
2121import Data.String (fromString)
2222import Data.Text.Encoding.Error
@@ -25,7 +25,7 @@ import Data.Text.Fusion.Size
2525import Data.Text.Lazy.Read as TL
2626import Data.Text.Read as T
2727import Data.Text.Search (indices)
28−import Data.Word (Word8, Word16, Word32)
28+import Data.Word (Word, Word8, Word16, Word32, Word64)
2929import Numeric (showHex)
3030import Prelude hiding (catch, replicate)
3131import Test.Framework (Test, testGroup)
@@ -628,7 +628,32 @@ tb_associative s1 s2 s3 =
628628tb_decimal :: (Integral a, Show a) => a -> Bool
629629tb_decimal = (TB.toLazyText . TB.decimal) `eq` (TL.pack . show)
630630
631+tb_decimal_integer (a::Integer) = tb_decimal a
632+tb_decimal_int (a::Int) = tb_decimal a
631633tb_decimal_int8 (a::Int8) = tb_decimal a
634+tb_decimal_int16 (a::Int16) = tb_decimal a
635+tb_decimal_int32 (a::Int32) = tb_decimal a
636+tb_decimal_int64 (a::Int64) = tb_decimal a
637+tb_decimal_word (a::Word) = tb_decimal a
638+tb_decimal_word8 (a::Word8) = tb_decimal a
639+tb_decimal_word16 (a::Word16) = tb_decimal a
640+tb_decimal_word32 (a::Word32) = tb_decimal a
641+tb_decimal_word64 (a::Word64) = tb_decimal a
642+
643+tb_hex :: (Integral a, Show a) => a -> Bool
644+tb_hex = (TB.toLazyText . TB.hexadecimal) `eq` (TL.pack . flip showHex "")
645+
646+tb_hexadecimal_integer (a::Integer) = tb_hex a
647+tb_hexadecimal_int (a::Int) = tb_hex a
648+tb_hexadecimal_int8 (a::Int8) = tb_hex a
649+tb_hexadecimal_int16 (a::Int16) = tb_hex a
650+tb_hexadecimal_int32 (a::Int32) = tb_hex a
651+tb_hexadecimal_int64 (a::Int64) = tb_hex a
652+tb_hexadecimal_word (a::Word) = tb_hex a
653+tb_hexadecimal_word8 (a::Word8) = tb_hex a
654+tb_hexadecimal_word16 (a::Word16) = tb_hex a
655+tb_hexadecimal_word32 (a::Word32) = tb_hex a
656+tb_hexadecimal_word64 (a::Word64) = tb_hex a
632657
633658-- Reading.
634659
@@ -1090,7 +1115,32 @@ tests =
10901115
10911116 testGroup "builder" [
10921117 testProperty "tb_associative" tb_associative,
1093− testProperty "tb_decimal_int8" tb_decimal_int8,
1118+ testGroup "decimal" [
1119+ testProperty "tb_decimal_int" tb_decimal_int,
1120+ testProperty "tb_decimal_int8" tb_decimal_int8,
1121+ testProperty "tb_decimal_int16" tb_decimal_int16,
1122+ testProperty "tb_decimal_int32" tb_decimal_int32,
1123+ testProperty "tb_decimal_int64" tb_decimal_int64,
1124+ testProperty "tb_decimal_integer" tb_decimal_integer,
1125+ testProperty "tb_decimal_word" tb_decimal_word,
1126+ testProperty "tb_decimal_word8" tb_decimal_word8,
1127+ testProperty "tb_decimal_word16" tb_decimal_word16,
1128+ testProperty "tb_decimal_word32" tb_decimal_word32,
1129+ testProperty "tb_decimal_word64" tb_decimal_word64
1130+ ],
1131+ testGroup "hexadecimal" [
1132+ testProperty "tb_hexadecimal_int" tb_hexadecimal_int,
1133+ testProperty "tb_hexadecimal_int8" tb_hexadecimal_int8,
1134+ testProperty "tb_hexadecimal_int16" tb_hexadecimal_int16,
1135+ testProperty "tb_hexadecimal_int32" tb_hexadecimal_int32,
1136+ testProperty "tb_hexadecimal_int64" tb_hexadecimal_int64,
1137+ testProperty "tb_hexadecimal_integer" tb_hexadecimal_integer,
1138+ testProperty "tb_hexadecimal_word" tb_hexadecimal_word,
1139+ testProperty "tb_hexadecimal_word8" tb_hexadecimal_word8,
1140+ testProperty "tb_hexadecimal_word16" tb_hexadecimal_word16,
1141+ testProperty "tb_hexadecimal_word32" tb_hexadecimal_word32,
1142+ testProperty "tb_hexadecimal_word64" tb_hexadecimal_word64
1143+ ],
10941144 testProperty "tb_fromText" tb_fromText,
10951145 testProperty "tb_singleton" tb_singleton
10961146 ],