Skip to content

Commit

Permalink
moderize cabal file
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Oct 31, 2015
1 parent f9a62f3 commit 7a81ab3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tests/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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])
Expand All @@ -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])
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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])
Expand All @@ -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])
Expand Down
16 changes: 13 additions & 3 deletions utf8-string.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7a81ab3

Please sign in to comment.