Skip to content

Commit b6aec43

Browse files
committed
Test sqrt for rings
1 parent 195b0e2 commit b6aec43

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/Rings-test.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ end
6363
end
6464
end
6565

66+
@testset "sqrt" begin
67+
Zx, x = ZZ[:x]
68+
69+
@test sqrt((x + 1)^2, check=true) == x + 1
70+
@testthrows ErrorException sqrt(-(x + 1)^2, check=true)
71+
@test is_square_with_sqrt(x^2) == (true, x)
72+
@test is_square_with_sqrt(2 * x^2)[1] == false
73+
end
74+
6675
@testset "properties" begin
6776
@test is_perfect(QQ)
6877
@test is_perfect(GF(2))

0 commit comments

Comments
 (0)