Skip to content

Commit 75a6688

Browse files
author
Wimmerer
committed
udf tests
1 parent f247011 commit 75a6688

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

test/operations/map.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
m = sprand(5, 5, 0.25)
33
n = GBMatrix(m)
44
@test map(UnaryOps.LOG, n)[1,1] == map(log, m)[1,1]
5-
o = map!(BinaryOps.GT, GBMatrix{Bool}(5, 5), 0.1, n)
5+
o = map!(>, GBMatrix{Bool}(5, 5), 0.1, n)
66
@test o[1,4] == (0.1 > m[1,4])
7-
@test map(BinaryOps.SECOND, n, 1.5)[1,1] == 1.5
7+
@test map(second, n, 1.5)[1,1] == 1.5
88
@test (n .* 10)[1,1] == n[1,1] * 10
9+
# Julia will map over the entire array, rather than just nnz.
10+
# so just test [1,1]
11+
@test map((x) -> 1.5, n)[1,1] == map((x) -> 1.5, m)[1,1]
912
end

test/sparsemat.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ using SuiteSparseGraphBLAS.SparseArrayCompat
1919
@test map(sin, A) map(sin, B)
2020
@test map(identity, A) == map(identity, B)
2121
@test map(cos, A) map(cos, B)
22-
22+
@test map((x)-> 1.5*x^2 + 3.0, A) map((x)-> 1.5*x^2 + 3.0, B)
2323
end

0 commit comments

Comments
 (0)