Skip to content

Commit

Permalink
Cover some corner cases error throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma committed Jan 26, 2021
1 parent 6f703f8 commit 17011ab
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Hecke.jl
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ end
function test_module(x, new::Bool = true)
julia_exe = Base.julia_cmd()
# On Windows, we also allow bla/blub"
x = _adjust_path
x = _adjust_path(x)
if x == "all"
test_file = joinpath(pkgdir, "test", "runtests.jl")
else
Expand Down
1 change: 1 addition & 0 deletions test/QuadForm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
@time include("QuadForm/MassHerm.jl")
@time include("QuadForm/Quad.jl")
@time include("QuadForm/QuadBin.jl")
@time include("QuadForm/Herm.jl")
end
3 changes: 3 additions & 0 deletions test/QuadForm/Herm.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@testset "Herm" begin
include("Herm/Spaces.jl")
end
18 changes: 18 additions & 0 deletions test/QuadForm/Herm/Spaces.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@testset "Spaces" begin
Qx, x = PolynomialRing(FlintQQ, "x")
K, a = NumberField(x^2 - 2, "a1")
Kt, t = K["t"]

E, b = NumberField(t^2 + 3)

F = GF(3)

Hecke.change_base_ring(::Hecke.NfRel, ::Hecke.gfp_mat) = error("asd")
@test_throws ErrorException hermitian_space(E, F[1 2; 2 1])

Hecke.change_base_ring(::Hecke.NfRel, x::Hecke.gfp_mat) = x
@test_throws ErrorException hermitian_space(E, F[1 2; 2 1])

V = @inferred hermitian_space(E, FlintQQ[1 2; 2 1])
@test V isa Hecke.HermSpace
end
7 changes: 7 additions & 0 deletions test/QuadForm/Quad/Spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
K2, a2 = NumberField(x^3 - 2, "a2")

K1t, t = PolynomialRing(K1, "t")
F = GF(3)

Hecke.change_base_ring(::FlintRationalField, ::Hecke.gfp_mat) = error("asd")
@test_throws ErrorException quadratic_space(FlintQQ, F[1 2; 2 1])

Hecke.change_base_ring(::FlintRationalField, x::Hecke.gfp_mat) = x
@test_throws ErrorException quadratic_space(FlintQQ, F[1 2; 2 1])

L, b = NumberField(t^2 + a1)

Expand Down

0 comments on commit 17011ab

Please sign in to comment.