Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #43

Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.6.1

- Use Unpadded base64 encoding, as it was done in v0.1.5.0

## 0.1.6.0

- Support base64-1.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ sudo dnf install -y ghc cabal-install && cabal update
Run the tests:

```ShellSession
$ cabal build all && cabal test all
$ ./bin/run-tests
```

Some tests requires a local matrix server, run integration service:
Expand Down
29 changes: 29 additions & 0 deletions bin/run-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh -e

log() {
/bin/echo -e "\n\x1b[1;33m[+] $*\x1b[0m";
}

log "Building"
cabal build -O0 --ghc-option=-Werror

log "Testing"
cabal test -O0 --test-show-details=direct
cabal check

log "Doctests"
cabal repl --with-compiler=doctest --repl-options='-w -Wdefault -XOverloadedStrings'

log "Formatting"
fourmolu -i src/ test/
cabal-gild --io matrix-client.cabal
nixfmt flake.nix

log "Linting"
hlint src/ test/

log "Check for diff"
if [ ! -z "$(git status --porcelain)" ]; then
git status
exit 1
fi
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
buildInputs = with pkgs.myHaskellPackages; [
cabal-install
doctest
cabal-gild
hlint
pkgs.haskell-language-server
pkgs.ghcid
Expand Down
163 changes: 88 additions & 75 deletions matrix-client.cabal
Original file line number Diff line number Diff line change
@@ -1,87 +1,100 @@
cabal-version: 2.4
name: matrix-client
version: 0.1.6.0
synopsis: A matrix client library
cabal-version: 2.4
name: matrix-client
version: 0.1.6.1
synopsis: A matrix client library
description:
Matrix client is a library to interface with https://matrix.org.
.
Use this library to interact with matrix server.
.
Read the "Network.Matrix.Tutorial" for a detailed tutorial.
.
Please see the README at https://github.com/softwarefactory-project/matrix-client-haskell#readme
.
homepage: https://github.com/softwarefactory-project/matrix-client-haskell#readme
bug-reports: https://github.com/softwarefactory-project/matrix-client-haskell/issues
license: Apache-2.0
license-file: LICENSE
author: Tristan de Cacqueray
maintainer: [email protected]
copyright: 2021 Red Hat
category: Network
build-type: Simple
extra-doc-files: CHANGELOG.md
extra-source-files: test/data/*.json
tested-with: GHC == 9.6.6
Matrix client is a library to interface with https://matrix.org.
.
Use this library to interact with matrix server.
.
Read the "Network.Matrix.Tutorial" for a detailed tutorial.
.
Please see the README at https://github.com/softwarefactory-project/matrix-client-haskell#readme
.

homepage: https://github.com/softwarefactory-project/matrix-client-haskell#readme
bug-reports: https://github.com/softwarefactory-project/matrix-client-haskell/issues
license: Apache-2.0
license-file: LICENSE
author: Tristan de Cacqueray
maintainer: [email protected]
copyright: 2021 Red Hat
category: Network
build-type: Simple
extra-doc-files: CHANGELOG.md
extra-source-files: test/data/*.json
tested-with: ghc ==9.6.6

source-repository head
type: git
location: https://github.com/softwarefactory-project/matrix-client-haskell.git
type: git
location: https://github.com/softwarefactory-project/matrix-client-haskell.git

common common-options
build-depends: base >= 4.11.0.0 && < 5
, aeson-casing >= 0.2.0.0 && < 0.3.0.0
, aeson >= 1.0.0.0 && < 3
ghc-options: -Wall
-Wcompat
-Widentities
-Wincomplete-uni-patterns
-Wincomplete-record-updates
-Wredundant-constraints
--write-ghc-environment-files=always
if impl(ghc >= 8.2)
ghc-options: -fhide-source-paths
if impl(ghc >= 8.4)
ghc-options: -Wmissing-export-lists
build-depends:
aeson >=1.0.0.0 && <3,
aeson-casing >=0.2.0.0 && <0.3.0.0,
base >=4.11.0.0 && <5,

ghc-options:
-Wall
-Wcompat
-Widentities
-Wincomplete-uni-patterns
-Wincomplete-record-updates
-Wredundant-constraints

--write-ghc-environment-files=always
if impl(ghc >=8.2)
ghc-options: -fhide-source-paths

default-language: Haskell2010
if impl(ghc >=8.4)
ghc-options: -Wmissing-export-lists
default-language: Haskell2010

common lib-depends
build-depends: SHA ^>= 1.6
, base64 >= 1.0
, bytestring >= 0.11.3 && < 0.13
, containers >= 0.6.5 && < 0.8
, exceptions >= 0.10.4 && < 0.11
, hashable >= 1.4.0 && < 1.5
, http-client >= 0.5.0 && < 0.8
, http-client-tls >= 0.2.0 && < 0.4
, http-types >= 0.10.0 && < 0.13
, network-uri >= 2.6.4 && < 2.7
, profunctors >= 5.6.2 && < 5.7
, retry >= 0.8 && < 0.10
, text >= 0.11.1.0 && < 3
, time >= 1.11.1 && < 1.13
, unordered-containers >= 0.2.17 && < 0.3
build-depends:
SHA ^>=1.6,
base64 >=1.0 && <2,
bytestring >=0.11.3 && <0.13,
containers >=0.6.5 && <0.8,
exceptions >=0.10.4 && <0.11,
hashable >=1.4.0 && <1.5,
http-client >=0.5.0 && <0.8,
http-client-tls >=0.2.0 && <0.4,
http-types >=0.10.0 && <0.13,
network-uri >=2.6.4 && <2.7,
profunctors >=5.6.2 && <5.7,
retry >=0.8 && <0.10,
text >=0.11.1.0 && <3,
time >=1.11.1 && <1.13,
unordered-containers >=0.2.17 && <0.3,

library
import: common-options, lib-depends
hs-source-dirs: src
exposed-modules: Network.Matrix.Client
, Network.Matrix.Client.Lens
, Network.Matrix.Identity
, Network.Matrix.Tutorial
other-modules: Network.Matrix.Events
, Network.Matrix.Internal
, Network.Matrix.Room
import: common-options, lib-depends
hs-source-dirs: src
exposed-modules:
Network.Matrix.Client
Network.Matrix.Client.Lens
Network.Matrix.Identity
Network.Matrix.Tutorial

other-modules:
Network.Matrix.Events
Network.Matrix.Internal
Network.Matrix.Room

test-suite unit
import: common-options, lib-depends
type: exitcode-stdio-1.0
hs-source-dirs: test, src
main-is: Spec.hs
build-depends: base
, bytestring
, aeson-pretty
, hspec >= 2
, matrix-client
, text
import: common-options, lib-depends
type: exitcode-stdio-1.0
hs-source-dirs:
test
src

main-is: Spec.hs
build-depends:
aeson-pretty,
base,
bytestring,
hspec >=2,
matrix-client,
text,
Loading
Loading