Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ myhist

# IDEs
.vscode

# Test suite
tests/dummy-μασ
3 changes: 2 additions & 1 deletion haskeline.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ tested-with:
GHC == 8.2.2
GHC == 8.0.2

extra-source-files: examples/Test.hs Changelog tests/dummy-μασ/bar tests/dummy-μασ/ςερτ
extra-source-files: examples/Test.hs Changelog

source-repository head
type: git
Expand Down Expand Up @@ -154,6 +154,7 @@ test-suite haskeline-tests
base >= 4.9 && < 4.23
, containers >= 0.4 && < 0.9
, bytestring >= 0.9 && < 0.13
, directory
, process >= 1.0 && < 1.7
-- dependencies for test-suite
, HUnit
Expand Down
9 changes: 9 additions & 0 deletions tests/Unit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Data.Word
import qualified Data.Text as T
import qualified Data.Text.Encoding as E
import Data.Monoid ((<>))
import System.Directory (createDirectoryIfMissing)
import System.Exit (exitFailure)
import System.Process (readProcess)
import Test.HUnit
Expand All @@ -34,6 +35,13 @@ legacyEncoding = False
whenLegacy :: BC.ByteString -> BC.ByteString
whenLegacy s = if legacyEncoding then s else B.empty

-- These files are used to test tab completion.
makeTestFiles :: IO ()
makeTestFiles = do
createDirectoryIfMissing True "tests/dummy-μασ"
writeFile "tests/dummy-μασ/bar" ""
writeFile "tests/dummy-μασ/ςερτ" ""

main :: IO ()
main = do
-- forkProcess needs an absolute path to the binary.
Expand All @@ -45,6 +53,7 @@ main = do
runInTTY = True,
environment = []
}
makeTestFiles
result <- runTestTT $ test [interactionTests i, fileStyleTests i]
when (errors result > 0 || failures result > 0) exitFailure

Expand Down
Empty file removed tests/dummy-μασ/bar
Empty file.
Empty file removed tests/dummy-μασ/ςερτ
Empty file.