Skip to content

Commit 2e3103e

Browse files
committed
Move spooky test that doesn't work unless in top level test file to top level test file
1 parent bf0af78 commit 2e3103e

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

test/reverse.jl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@ using Test
1212
const fwd = Diffractor.PrimeDerivativeFwd
1313
const bwd = Diffractor.PrimeDerivativeBack
1414

15-
# Unit tests
16-
function tup2(f)
17-
a, b = ∂⃖{2}()(f, 1)
18-
c, d = b((2,))
19-
e, f = d(ZeroTangent(), 3)
20-
f((4,))
21-
end
22-
23-
@test tup2(tuple) == (NoTangent(), 4)
24-
25-
my_tuple(args...) = args
26-
ChainRules.rrule(::typeof(my_tuple), args...) = args, Δ->Core.tuple(NoTangent(), Δ...)
27-
@test tup2(my_tuple) == (ZeroTangent(), 4)
2815

2916
# Check characteristic of exp rule
3017
# broken see: https://github.com/JuliaDiff/Diffractor.jl/pull/142

test/runtests.jl

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,30 @@ const bwd = Diffractor.PrimeDerivativeBack
2020
"forward.jl",
2121
"reverse.jl",
2222
"regression.jl",
23+
#"pinn.jl", # Higher order control flow not yet supported (https://github.com/JuliaDiff/Diffractor.jl/issues/24)
2324
)
2425
include(file)
2526
end
2627

28+
# 👻 The following code belongs in "test/reverse.jl" but if moved there it does not work anymore 👻
29+
# Unit tests
30+
function tup2(f)
31+
a, b = ∂⃖{2}()(f, 1)
32+
c, d = b((2,))
33+
e, f = d(ZeroTangent(), 3)
34+
f((4,))
35+
end
36+
37+
@test tup2(tuple) == (NoTangent(), 4)
38+
39+
my_tuple(args...) = args
40+
ChainRules.rrule(::typeof(my_tuple), args...) = args, Δ->Core.tuple(NoTangent(), Δ...)
41+
42+
@test tup2(my_tuple) == (ZeroTangent(), 4)
43+
44+
45+
2746

2847

29-
# Higher order control flow not yet supported (https://github.com/JuliaDiff/Diffractor.jl/issues/24)
30-
#include("pinn.jl")
3148

3249
end # overall testset

0 commit comments

Comments
 (0)