diff --git a/.travis.yml b/.travis.yml
index 0107d57bb5b30493a4ae60bb5ee08039eee5d27c..e74df3d5c30b1cad26c00d17a26889ed78f3887a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,9 +25,9 @@ matrix:
- env: CABALVER=1.18 GHCVER=7.8.4
compiler: ": #GHC 7.8.4"
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
- - env: CABALVER=1.22 GHCVER=7.10.1
- compiler: ": #GHC 7.10.1"
- addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}}
+ - env: CABALVER=1.22 GHCVER=7.10.2
+ compiler: ": #GHC 7.10.2"
+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
before_install:
- unset CC
diff --git a/tests/Tests.hs b/tests/Tests.hs
index 448073f2683954192a5be5151a077bbfffc35f8a..b97b5f17bedae68ba81b1b7683ed9a466ce9ed3c 100644
--- a/tests/Tests.hs
+++ b/tests/Tests.hs
@@ -16,7 +16,7 @@ test_2 = TestLabel "2 Boundary condition test cases" $
TestList [test_2_1, test_2_2, test_2_3]
test_2_1 = TestLabel "2.1 First possible sequence of a certain length" $
- TestList $ map TestCase $
+ TestList $ map TestCase $
[ assertEqual "2.1.1, " "\0\0" (decode [0, 0])
, assertEqual "2.1.2, " "\x80\0" (decode [0xc2, 0x80, 0])
, assertEqual "2.1.3, " "\x800\0" (decode [0xe0, 0xa0, 0x80, 0])
@@ -26,7 +26,7 @@ test_2_1 = TestLabel "2.1 First possible sequence of a certain length" $
]
test_2_2 = TestLabel "2.2 Last possible sequence of a certain length" $
- TestList $ map TestCase $
+ TestList $ map TestCase $
[ assertEqual "2.2.1, " "\x7f\0" (decode [0x7f, 0])
, assertEqual "2.2.2, " "\x7ff\0" (decode [0xdf, 0xbf, 0])
, assertEqual "2.2.3, " "\xfffd\0" (decode [0xef, 0xbf, 0xbf, 0])
@@ -36,7 +36,7 @@ test_2_2 = TestLabel "2.2 Last possible sequence of a certain length" $
]
test_2_3 = TestLabel "2.3 Other boundary conditions" $
- TestList $ map TestCase $
+ TestList $ map TestCase $
[ assertEqual "2.3.1, " "\xd7ff\0" (decode [0xed, 0x9f, 0xbf, 0])
, assertEqual "2.3.2, " "\xe000\0" (decode [0xee, 0x80, 0x80, 0])
, assertEqual "2.3.3, " "\xfffd\0" (decode [0xef, 0xbf, 0xbd, 0])
@@ -92,7 +92,7 @@ test_3_3 = TestLabel "3.3 Sequences with last continuation byte missing" $
]
test_3_4 = TestLabel "3.4 Concatenation of incomplete sequences" $
- TestCase $ assertEqual "3.4, "
+ TestCase $ assertEqual "3.4, "
(replicate 10 '\xfffd')
(decode [0xc0, 0xe0, 0x80, 0xf0, 0x80, 0x80, 0xf8, 0x80, 0x80, 0x80,
0xfc, 0x80, 0x80, 0x80,0x80, 0xdf, 0xef, 0xbf, 0xf7, 0xbf, 0xbf,
@@ -148,7 +148,7 @@ test_5_1 = TestLabel "5.1 Single UTF-16 surrogates" $
, assertEqual "5.1.6, " "\xfffd " (decode [0xed,0xbe,0x80,0x20])
, assertEqual "5.1.7, " "\xfffd " (decode [0xed,0xbf,0xbf,0x20])
]
-
+
test_5_2 = TestLabel "5.2 Paired UTF-16 surrogates" $
TestList $ map TestCase $
[ assertEqual "5.2.1, " res (decode [0xed,0xa0,0x80,0xed,0xb0,0x80,0x20])
@@ -161,7 +161,7 @@ test_5_2 = TestLabel "5.2 Paired UTF-16 surrogates" $
, assertEqual "5.2.8, " res (decode [0xed,0xaf,0xbf,0xed,0xbf,0xbf,0x20])
]
where res = "\xfffd\xfffd "
-
+
test_5_3 = TestLabel "5.3 Other illegal code positions" $
TestList $ map TestCase $
[ assertEqual "5.3.1, " "\xfffd " (decode [0xef, 0xbf, 0xbe, 0x20])
diff --git a/utf8-string.cabal b/utf8-string.cabal
index 5eb52d76c8a4197dc143852235f8a99a398b6099..c780ae506cda9ba3abd6acf771daf7277f9e9d7a 100644
--- a/utf8-string.cabal
+++ b/utf8-string.cabal
@@ -12,18 +12,28 @@ Description: A UTF8 layer for Strings. The utf8-string
writing UTF8 without truncation.
Category: Codec
Build-type: Simple
-cabal-version: >= 1.2
+cabal-version: >= 1.10
Extra-Source-Files: CHANGELOG.markdown
Tested-With: GHC==7.0.4, GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.2
+source-repository head
+ type: git
+ location: https://github.com/glguy/utf8-string
+
library
Ghc-options: -W -O2
- build-depends: base >= 4.3 && < 4.9, bytestring >= 0.9
+ build-depends: base >= 4.3 && < 4.9, bytestring >= 0.9
- Extensions: CPP
Exposed-modules: Codec.Binary.UTF8.String
Codec.Binary.UTF8.Generic
Data.String.UTF8
Data.ByteString.UTF8
Data.ByteString.Lazy.UTF8
+
+ default-language: Haskell2010
+
+test-suite unit-tests
+ type: exitcode-stdio-1.0
+ main-is: tests/Tests.hs
+ build-depends: HUnit >= 1.3 && < 1.4