|
89 | 89 |
|
90 | 90 | @testset "AbstractThunk $(typeof(thunk))" for thunk in ( |
91 | 91 | @thunk(-1.0*ones(2, 2)), |
92 | | - InplaceableThunk(@thunk(-1.0*ones(2, 2)), x -> x .-= ones(2, 2)), |
| 92 | + InplaceableThunk(x -> x .-= ones(2, 2), @thunk(-1.0*ones(2, 2))), |
93 | 93 | ) |
94 | 94 | @testset "in place" begin |
95 | 95 | accumuland = [1.0 2.0; 3.0 4.0] |
|
109 | 109 | end |
110 | 110 |
|
111 | 111 | @testset "not actually inplace but said it was" begin |
112 | | - ithunk = InplaceableThunk( |
113 | | - @thunk(@assert false), # this should never be used in this test |
114 | | - x -> 77*ones(2, 2) # not actually inplace (also wrong) |
115 | | - ) |
| 112 | + # thunk should never be used in this test |
| 113 | + ithunk = InplaceableThunk(@thunk(@assert false)) do x |
| 114 | + 77*ones(2, 2) # not actually inplace (also wrong) |
| 115 | + end |
116 | 116 | accumuland = ones(2, 2) |
117 | 117 | @assert ChainRulesCore.debug_mode() == false |
118 | 118 | # without debug being enabled should return the result, not error |
|
127 | 127 |
|
128 | 128 | @testset "showerror BadInplaceException" begin |
129 | 129 | BadInplaceException = ChainRulesCore.BadInplaceException |
130 | | - ithunk = InplaceableThunk(@thunk(@assert false), x̄->nothing) |
| 130 | + ithunk = InplaceableThunk(x̄->nothing, @thunk(@assert false)) |
131 | 131 | msg = sprint(showerror, BadInplaceException(ithunk, [22], [23])) |
132 | 132 | @test occursin("22", msg) |
133 | 133 |
|
|
0 commit comments