Skip to content

Commit

Permalink
Include DocTests in UnitTests
Browse files Browse the repository at this point in the history
  • Loading branch information
CiaranOMara committed Apr 16, 2023
1 parent 9630bf0 commit 461e3a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ version = "1.0.0"
julia = "0.7, 1"

[extras]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Random", "Test"]
test = ["Documenter", "Random", "Test"]
10 changes: 8 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env julia
using Test
using Documenter

using IntervalTrees
import IntervalTrees: Slice, InternalNode, LeafNode, Interval, IntervalBTree
using Test
using Random: seed!, shuffle!


# Convert
@testset "Convert and constructors" begin
@test Interval(1:5) == Interval(1, 5)
Expand Down Expand Up @@ -662,3 +662,9 @@ end
push!(node, IntervalValue{Int, Int}(1, 1, 1))
@test IntervalTrees.findidx(node, x) == 1
end

@testset "DocTests" begin
# Include doctests.
DocMeta.setdocmeta!(IntervalTrees, :DocTestSetup, :(using IntervalTrees); recursive=true)
doctest(IntervalTrees; manual = false)
end

0 comments on commit 461e3a4

Please sign in to comment.