Skip to content

Commit 586e691

Browse files
authored
Merge pull request #98 from JuliaParallel/vc/unary
Fixes unary `-` x-ref #68
2 parents 4adac67 + 28e496a commit 586e691

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

src/mapreduce.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ for f in (:.+, :.-, :.*, :./, :.%, :.<<, :.>>)
222222
end
223223

224224
### Should be deleted when broadcast is defined
225-
for f in (:abs, :abs2, :acos, :acosd, :acosh, :acot, :acotd, :acoth,
225+
for f in (:-, :abs, :abs2, :acos, :acosd, :acosh, :acot, :acotd, :acoth,
226226
:acsc, :acscd, :acsch, :angle, :asec, :asecd, :asech, :asin,
227227
:asind, :asinh, :atan, :atand, :atanh, :big, :cbrt, :ceil, :cis,
228228
:complex, :cos, :cosc, :cosd, :cosh, :cospi, :cot, :cotd, :coth,

test/darray.jl

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -629,25 +629,25 @@ check_leaks()
629629
@testset "test scalar math" begin
630630
a = drand(20, 20);
631631
b = convert(Array, a)
632-
@testset "$f" for f in (:abs, :abs2, :acos, :acosd, :acot,
633-
:acotd, :acsch, :angle, :asech, :asin,
634-
:asind, :asinh, :atan, :atand, :atanh,
635-
:big, :cbrt, :ceil, :cis, :complex, :conj,
636-
:cos, :cosc, :cosd, :cosh, :cospi, :cot,
637-
:cotd, :coth, :csc, :cscd, :csch, :dawson,
638-
:deg2rad, :digamma, :erf, :erfc, :erfcinv,
639-
:erfcx, :erfi, :erfinv, :exp, :exp10, :exp2,
640-
:expm1, :exponent, :float, :floor, :gamma, :imag,
641-
:invdigamma, :isfinite, :isinf, :isnan, :lfact,
642-
:lgamma, :log, :log10, :log1p, :log2, :rad2deg, :real,
643-
:sec, :secd, :sech, :sign, :sin, :sinc, :sind,
644-
:sinh, :sinpi, :sqrt, :tan, :tand, :tanh, :trigamma)
645-
@test (eval(f))(a) == (eval(f))(b)
632+
@testset "$f" for f in (-, abs, abs2, acos, acosd, acot,
633+
acotd, acsch, angle, asech, asin,
634+
asind, asinh, atan, atand, atanh,
635+
big, cbrt, ceil, cis, complex, conj,
636+
cos, cosc, cosd, cosh, cospi, cot,
637+
cotd, coth, csc, cscd, csch, dawson,
638+
deg2rad, digamma, erf, erfc, erfcinv,
639+
erfcx, erfi, erfinv, exp, exp10, exp2,
640+
expm1, exponent, float, floor, gamma, imag,
641+
invdigamma, isfinite, isinf, isnan, lfact,
642+
lgamma, log, log10, log1p, log2, rad2deg, real,
643+
sec, secd, sech, sign, sin, sinc, sind,
644+
sinh, sinpi, sqrt, tan, tand, tanh, trigamma)
645+
@test f(a) == f(b)
646646
end
647647
a = a + 1
648648
b = b + 1
649-
@testset "$f" for f in (:asec, :asecd, :acosh, :acsc, :acscd, :acoth)
650-
@test (eval(f))(a) == (eval(f))(b)
649+
@testset "$f" for f in (asec, asecd, acosh, acsc, acscd, acoth)
650+
@test f(a) == f(b)
651651
end
652652
close(a)
653653
darray_closeall() # close the temporaries created above
@@ -708,27 +708,27 @@ check_leaks()
708708
c = drand(20,20)
709709
d = convert(Array, c)
710710

711-
@testset "$f" for f in (:+, :-, :.+, :.-, :.*, :./, :.%, :div, :mod)
711+
@testset "$f" for f in (+, -, .+, .-, .*, ./, .%, div, mod)
712712
x = rand()
713-
@test (eval(f))(a, x) == (eval(f))(b, x)
714-
@test (eval(f))(x, a) == (eval(f))(x, b)
715-
@test (eval(f))(a, c) == (eval(f))(b, d)
713+
@test f(a, x) == f(b, x)
714+
@test f(x, a) == f(x, b)
715+
@test f(a, c) == f(b, d)
716716
end
717717

718718
close(a)
719719
close(c)
720720

721721
a = dones(Int, 20, 20)
722722
b = convert(Array, a)
723-
@testset "$f" for f in (:.<<, :.>>)
724-
@test (eval(f))(a, 2) == (eval(f))(b, 2)
725-
@test (eval(f))(2, a) == (eval(f))(2, b)
726-
@test (eval(f))(a, a) == (eval(f))(b, b)
723+
@testset "$f" for f in (.<<, .>>)
724+
@test f(a, 2) == f(b, 2)
725+
@test f(2, a) == f(2, b)
726+
@test f(a, a) == f(b, b)
727727
end
728728

729-
@testset "$f" for f in (:rem,)
729+
@testset "$f" for f in (rem,)
730730
x = rand()
731-
@test (eval(f))(a, x) == (eval(f))(b, x)
731+
@test f(a, x) == f(b, x)
732732
end
733733
close(a)
734734
close(c)

0 commit comments

Comments
 (0)