Skip to content

Commit b6301e8

Browse files
authored
Fix doctest failure (#75)
* make jldoctest deterministic The order in which DiffRules.diffrules() outputs things is not deterministic. This means this jldoctest can fail. Here we make it so that the output is deterministic. * David's suggestion
1 parent 68cd4f2 commit b6301e8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/api.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,14 @@ To include all rules, specify `filter_modules = nothing`.
139139
# Examples
140140
141141
```jldoctest
142-
julia> first(DiffRules.diffrules())
143-
(:Base, :log2, 1)
142+
julia> first(DiffRules.diffrules()) isa Tuple{Symbol,Symbol,Int}
143+
true
144+
145+
julia> (:Base, :log, 1) in DiffRules.diffrules()
146+
true
147+
148+
julia> (:Base, :*, 2) in DiffRules.diffrules()
149+
true
144150
```
145151
146152
If you call `diffrules()`, only rules for Base, SpecialFunctions, and

0 commit comments

Comments
 (0)