Browse Source

Update CI configuration, add some tests.

pull/1/head
Fredrik Ekre 4 years ago
parent
commit
bc0793c5c3
  1. 5
      .github/workflows/ci.yml
  2. 2
      LICENSE
  3. 10
      README.md
  4. 2
      src/TeeStreams.jl
  5. 6
      test/runtests.jl

5
.github/workflows/ci.yml

@ -15,6 +15,7 @@ jobs: @@ -15,6 +15,7 @@ jobs:
strategy:
matrix:
version:
- '1.6'
- '1'
- 'nightly'
os:
@ -32,6 +33,6 @@ jobs: @@ -32,6 +33,6 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v2
with:
file: lcov.info
files: lcov.info

2
LICENSE

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
MIT License
Copyright (c) 2021 Fredrik Ekre
Copyright (c) 2021-2022 Fredrik Ekre
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

10
README.md

@ -1,5 +1,8 @@ @@ -1,5 +1,8 @@
# TeeStreams
[![CI][gh-actions-img]][gh-actions-url]
[![codecov][codecov-img]][codecov-url]
Simplify writing to multiple streams at once.
## Usage
@ -68,3 +71,10 @@ expected_shasum = "f190c938dd6fed97021953240523c9db448ec0a6760b574afd4e9924ab561 @@ -68,3 +71,10 @@ expected_shasum = "f190c938dd6fed97021953240523c9db448ec0a6760b574afd4e9924ab561
download_verify(url, expected_shasum)
```
[gh-actions-img]: https://github.com/fredrikekre/TeeStreams.jl/actions/workflows/ci.yml/badge.svg?branch=master&event=push
[gh-actions-url]: https://github.com/fredrikekre/TeeStreams.jl/actions/workflows/ci.yml
[codecov-img]: https://codecov.io/gh/fredrikekre/TeeStreams.jl/branch/master/graph/badge.svg?token=K7C8OASVZR
[codecov-url]: https://codecov.io/gh/fredrikekre/TeeStreams.jl

2
src/TeeStreams.jl

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
# SPDX-License-Identifier: MIT
module TeeStreams
export TeeStream

6
test/runtests.jl

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
# SPDX-License-Identifier: MIT
using TeeStreams, Test, SimpleBufferStream, HTTP,
CodecZlib, CodecZstd, SHA, Tar
@ -35,11 +37,12 @@ end @@ -35,11 +37,12 @@ end
bs = BufferStream()
tee = TeeStream(iob, ioc, iof, bs)
write_things(tee)
flush(tee)
close(iof); close(bs)
@test String(take!(iob)) == String(take!(ioc.io)) ==
read(f, String) == read(bs, String) == correct
try
close(tee)
try
write_things(tee)
catch err
@test err isa CompositeException
@ -57,6 +60,7 @@ end @@ -57,6 +60,7 @@ end
@test isopen(io2)
TeeStream(io1, io2) do tee
write_things(tee)
flush(tee)
end
@test !isopen(io1)
@test !isopen(io2)

Loading…
Cancel
Save