Skip to content

Commit

Permalink
tests: fix global state for doctests (#1769)
Browse files Browse the repository at this point in the history
* tests: reset abelian_closure variable name after printing test

* tests: StraightLinePrograms put tests in submodule to avoid polluting main namespace too much
  • Loading branch information
benlorenz committed Nov 28, 2022
1 parent babd9be commit 8efd6fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/Rings/AbelianClosure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ end

a = @inferred root_of_unity(K, 4)
@test isone(a^4) && !isone(a) && !isone(a^2)

# reset variable for any subsequent (doc-)tests
set_variable!(K, "ζ")
end

@testset "Coercion" begin
Expand Down
8 changes: 8 additions & 0 deletions test/StraightLinePrograms/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# avoid polluting the main namespace to to preserve proper printing in doctests
module SLPTest
using ..Test
using ..Oscar
using ..Oscar: SLP

include("setup.jl")
include("straightline.jl")
include("gap.jl")
include("atlas.jl")

end

0 comments on commit 8efd6fb

Please sign in to comment.