Skip to content

Commit

Permalink
more manual eta reduction (companion to 9cead4f) (JuliaLang#17982)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski authored Aug 12, 2016
1 parent 3650b92 commit 585fe0e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1556,8 +1556,8 @@ copy!(S, A)
@test cumsum(A, 1) == cumsum(B, 1) == cumsum(S, 1)
@test cumsum(A, 2) == cumsum(B, 2) == cumsum(S, 2)

@test mapslices(v->sort(v), A, 1) == mapslices(v->sort(v), B, 1) == mapslices(v->sort(v), S, 1)
@test mapslices(v->sort(v), A, 2) == mapslices(v->sort(v), B, 2) == mapslices(v->sort(v), S, 2)
@test mapslices(sort, A, 1) == mapslices(sort, B, 1) == mapslices(sort, S, 1)
@test mapslices(sort, A, 2) == mapslices(sort, B, 2) == mapslices(sort, S, 2)

@test flipdim(A, 1) == flipdim(B, 1) == flipdim(S, 2)
@test flipdim(A, 2) == flipdim(B, 2) == flipdim(S, 2)
Expand Down
4 changes: 2 additions & 2 deletions test/functional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ let a = [1.0, 2.0]
@test isequal(a, sin([1.0, 2.0]))
end
# map -- ranges.jl
@test isequal(map(i->sqrt(i), 1:5), [sqrt(i) for i in 1:5])
@test isequal(map(i->sqrt(i), 2:6), [sqrt(i) for i in 2:6])
@test isequal(map(sqrt, 1:5), [sqrt(i) for i in 1:5])
@test isequal(map(sqrt, 2:6), [sqrt(i) for i in 2:6])

# map on ranges should evaluate first value only once (#4453)
let io=IOBuffer(3)
Expand Down
4 changes: 2 additions & 2 deletions test/offsetarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ v = OffsetArray(rand(8), (-2,))
@test sort(A, 1) == OffsetArray(sort(parent(A), 1), A.offsets)
@test sort(A, 2) == OffsetArray(sort(parent(A), 2), A.offsets)

@test mapslices(v->sort(v), A, 1) == OffsetArray(mapslices(v->sort(v), parent(A), 1), A.offsets)
@test mapslices(v->sort(v), A, 2) == OffsetArray(mapslices(v->sort(v), parent(A), 2), A.offsets)
@test mapslices(sort, A, 1) == OffsetArray(mapslices(sort, parent(A), 1), A.offsets)
@test mapslices(sort, A, 2) == OffsetArray(mapslices(sort, parent(A), 2), A.offsets)

@test rotl90(A) == OffsetArray(rotl90(parent(A)), A.offsets[[2,1]])
@test rotr90(A) == OffsetArray(rotr90(parent(A)), A.offsets[[2,1]])
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ end
# issue #15406
v15406 = remotecall_wait(() -> 1, id_other)
fetch(v15406)
remotecall_wait(t -> fetch(t), id_other, v15406)
remotecall_wait(fetch, id_other, v15406)

# Test various forms of remotecall* invocations

Expand Down
4 changes: 2 additions & 2 deletions test/reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ prod2(itr) = invoke(prod, Tuple{Any}, itr)
@test maxabs([1, -2, 3, -4]) == 4
@test minabs([-1, 2, -3, 4]) == 1

@test maximum(x->abs2(x), 3:7) == 49
@test minimum(x->abs2(x), 3:7) == 9
@test maximum(abs2, 3:7) == 49
@test minimum(abs2, 3:7) == 9

@test maximum(Int16[1]) === Int16(1)
@test maximum(collect(Int16(1):Int16(100))) === Int16(100)
Expand Down
2 changes: 1 addition & 1 deletion test/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test_code_reflections(test_bin_reflection, code_native)
mktemp() do f, io
OLDSTDOUT = STDOUT
redirect_stdout(io)
@test try @code_native map(y->abs(y), rand(3)); true; catch false; end
@test try @code_native map(abs, rand(3)); true; catch false; end
redirect_stdout(OLDSTDOUT)
end

Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cd(dirname(@__FILE__)) do
test = shift!(tests)
local resp
try
resp = remotecall_fetch(t -> runtests(t), p, test)
resp = remotecall_fetch(runtests, p, test)
catch e
resp = e
end
Expand Down

0 comments on commit 585fe0e

Please sign in to comment.