Skip to content

Commit

Permalink
Test Transducer(::Reduction)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Jan 13, 2019
1 parent bbcc477 commit 0fdd763
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/preamble.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Random
using SparseArrays: issparse, sparse
using Statistics: mean
using Transducers
using Transducers: simple_transduce, Reduced, isexpansive,
using Transducers: Transducer, simple_transduce, Reduced, isexpansive,
TeeZip, GetIndex, SetIndex, Inject

inc(x) = x + oneunit(x)
Expand Down
12 changes: 12 additions & 0 deletions test/test_processes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ end
end
end

@testset "Transducer(::Reduction)" begin
# testing Transducer(::Eduction) which calls Transducer(::Reduction)
@testset for xf in [
Map(sin),
TeeZip(Filter(isfinite) |> Map(tan)),
Map(sin) |> TeeZip(Filter(isfinite) |> Map(tan)) |>
Map(cos),
]
@test Transducer(eduction(xf, 1:1)) === xf
end
end

@testset "isexpansive" begin
expansives = [
Cat()
Expand Down

0 comments on commit 0fdd763

Please sign in to comment.