Skip to content

Commit 8f74f54

Browse files
author
Miha Zgubic
committed
add tests
1 parent a8825c9 commit 8f74f54

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

test/rulesets/Base/sort.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@testset "sort.jl" begin
2+
@testset "sort" begin
3+
a = rand(10)
4+
test_rrule(sort, a)
5+
test_rrule(sort, a; fkwargs=(;rev=true))
6+
end
7+
@testset "partialsort" begin
8+
a = rand(10)
9+
test_rrule(partialsort, a, 4 nothing)
10+
test_rrule(partialsort, a, 3:5 nothing)
11+
test_rrule(partialsort, a, 1:2:6 nothing)
12+
13+
test_rrule(partialsort, a, 4 nothing, fkwargs=(;rev=true))
14+
end
15+
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ println("Testing ChainRules.jl")
3232
include_test("rulesets/Base/arraymath.jl")
3333
include_test("rulesets/Base/indexing.jl")
3434
include_test("rulesets/Base/mapreduce.jl")
35+
include_test("rulesets/Base/sort.jl")
3536
end
3637
println()
3738

0 commit comments

Comments
 (0)