Skip to content

Commit 9514a70

Browse files
committed
Make test-suite to use text package instead of its source files
1 parent 1667974 commit 9514a70

File tree

5 files changed

+10
-114
lines changed

5 files changed

+10
-114
lines changed

tests/Tests/Regressions.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
-- | Regression tests for specific bugs.
22
--
3-
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}
3+
{-# LANGUAGE MagicHash #-}
4+
{-# LANGUAGE OverloadedStrings #-}
5+
{-# LANGUAGE ScopedTypeVariables #-}
6+
47
module Tests.Regressions
58
(
69
tests
710
) where
811

912
import Control.Exception (SomeException, handle)
1013
import Data.Char (isLetter)
14+
import GHC.Exts (Int(..), sizeofByteArray#)
1115
import System.IO
1216
import Test.Tasty.HUnit (assertBool, assertEqual, assertFailure)
1317
import qualified Data.ByteString as B
@@ -105,8 +109,8 @@ t227 =
105109
t301 :: IO ()
106110
t301 = do
107111
assertEqual "The length of the array remains the same despite slicing"
108-
(TA.length originalArr)
109-
(TA.length newArr)
112+
(I# (sizeofByteArray# (TA.aBA originalArr)))
113+
(I# (sizeofByteArray# (TA.aBA newArr)))
110114

111115
assertEqual "The new array still contains the original value"
112116
(T.Text newArr originalOff originalLen)

tests/cbits

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/include

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/src

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/text-tests.cabal

Lines changed: 3 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -60,36 +60,12 @@ tested-with: GHC==9.0.1,
6060
GHC==8.10.4, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4,
6161
GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4,
6262
GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
63-
extra-source-files:
64-
include/*.h
65-
66-
flag bytestring-builder
67-
description:
68-
Depend on the [bytestring-builder](https://hackage.haskell.org/package/bytestring-builder)
69-
package for backwards compatibility.
70-
default: False
71-
manual: False
72-
73-
flag integer-simple
74-
description:
75-
Use the [simple integer library](http://hackage.haskell.org/package/integer-simple)
76-
instead of [integer-gmp](http://hackage.haskell.org/package/integer-gmp)
77-
default: False
78-
manual: False
7963

8064
test-suite tests
8165
type: exitcode-stdio-1.0
82-
c-sources: cbits/cbits.c
83-
include-dirs: include
84-
hs-source-dirs: src
85-
8666
ghc-options:
8767
-Wall -threaded -rtsopts
8868

89-
cpp-options:
90-
-DASSERTS -DTEST_SUITE
91-
92-
-- modules specific to test-suite
9369
hs-source-dirs: .
9470
main-is: Tests.hs
9571
other-modules:
@@ -100,103 +76,22 @@ test-suite tests
10076
Tests.SlowFunctions
10177
Tests.Utils
10278

103-
-- This can be merged back to `text` package, when cabal
104-
-- will support per-component solving. Otherwise we have loops.
105-
--
106-
-- Same as in `library` stanza; this is needed by cabal for accurate
107-
-- file-monitoring as well as to avoid `-Wmissing-home-modules`
108-
-- warnings We can't use an inter-package library dependency because
109-
-- of different `ghc-options`/`cpp-options` (as a side-benefitt,
110-
-- this enables per-component build parallelism in `cabal
111-
-- new-build`!); We could, however, use cabal-version:2.2's `common`
112-
-- blocks at some point in the future to reduce the duplication.
113-
other-modules:
114-
Data.Text
115-
Data.Text.Array
116-
Data.Text.Encoding
117-
Data.Text.Encoding.Error
118-
Data.Text.Foreign
119-
Data.Text.IO
120-
Data.Text.Internal
121-
Data.Text.Internal.Builder
122-
Data.Text.Internal.Builder.Functions
123-
Data.Text.Internal.Builder.Int.Digits
124-
Data.Text.Internal.Builder.RealFloat.Functions
125-
Data.Text.Internal.ByteStringCompat
126-
Data.Text.Internal.PrimCompat
127-
Data.Text.Internal.Encoding.Fusion
128-
Data.Text.Internal.Encoding.Fusion.Common
129-
Data.Text.Internal.Encoding.Utf16
130-
Data.Text.Internal.Encoding.Utf32
131-
Data.Text.Internal.Encoding.Utf8
132-
Data.Text.Internal.Functions
133-
Data.Text.Internal.Fusion
134-
Data.Text.Internal.Fusion.CaseMapping
135-
Data.Text.Internal.Fusion.Common
136-
Data.Text.Internal.Fusion.Size
137-
Data.Text.Internal.Fusion.Types
138-
Data.Text.Internal.IO
139-
Data.Text.Internal.Lazy
140-
Data.Text.Internal.Lazy.Encoding.Fusion
141-
Data.Text.Internal.Lazy.Fusion
142-
Data.Text.Internal.Lazy.Search
143-
Data.Text.Internal.Private
144-
Data.Text.Internal.Read
145-
Data.Text.Internal.Search
146-
Data.Text.Internal.Unsafe
147-
Data.Text.Internal.Unsafe.Char
148-
Data.Text.Internal.Unsafe.Shift
149-
Data.Text.Lazy
150-
Data.Text.Lazy.Builder
151-
Data.Text.Lazy.Builder.Int
152-
Data.Text.Lazy.Builder.RealFloat
153-
Data.Text.Lazy.Encoding
154-
Data.Text.Lazy.IO
155-
Data.Text.Lazy.Internal
156-
Data.Text.Lazy.Read
157-
Data.Text.Read
158-
Data.Text.Unsafe
159-
Data.Text.Show
160-
16179
build-depends:
16280
QuickCheck >= 2.14.1 && < 2.15,
163-
array,
16481
base <5,
165-
binary,
82+
bytestring,
16683
deepseq,
16784
directory,
168-
ghc-prim,
16985
quickcheck-unicode >= 1.0.1.0,
17086
random,
171-
template-haskell,
17287
tasty,
17388
tasty-hunit,
174-
tasty-quickcheck
175-
176-
if flag(bytestring-builder)
177-
build-depends: bytestring >= 0.9 && < 0.10.4,
178-
bytestring-builder >= 0.10.4
179-
else
180-
build-depends: bytestring >= 0.10.4
181-
182-
if impl(ghc >= 8.11)
183-
build-depends: ghc-bignum
184-
185-
if impl(ghc < 8.11)
186-
if flag(integer-simple)
187-
cpp-options: -DINTEGER_SIMPLE
188-
build-depends: integer-simple >= 0.1 && < 0.5
189-
else
190-
cpp-options: -DINTEGER_GMP
191-
build-depends: integer-gmp >= 0.2
89+
tasty-quickcheck,
90+
text
19291

19392
default-language: Haskell2010
19493
default-extensions: NondecreasingIndentation
19594

19695
source-repository head
19796
type: git
19897
location: https://github.com/haskell/text
199-
200-
source-repository head
201-
type: mercurial
202-
location: https://bitbucket.org/bos/text

0 commit comments

Comments
 (0)