Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

booktest: add error checking for non-jlcon files also on master #4209

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Groups/GAPGroups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,16 @@ end

Base.:*(x::GAPGroupElem, y::GAPGroupElem) = _prod(x, y)


isequal(x::GAPGroup, y::GAPGroup) = GapObj(x) == GapObj(y)

function ==(x::GAPGroup, y::GAPGroup)
_check_compatible(x, y)
return GapObj(x) == GapObj(y)
end

isequal(x::BasicGAPGroupElem, y::BasicGAPGroupElem) = GapObj(x) == GapObj(y)

# For two `BasicGAPGroupElem`s,
# we allow the question for equality if their parents fit together
# in the sense of `_check_compatible`,
Expand Down
2 changes: 0 additions & 2 deletions test/book/cornerstones/groups/auxiliary_code/main.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Pkg
Pkg.add(name="GenericCharacterTables", version="0.4"; io=devnull)
using GenericCharacterTables
# for nicer printing
using GenericCharacterTables: ParameterException
21 changes: 20 additions & 1 deletion test/book/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,18 @@ isdefined(Main, :FakeTerminals) || include(joinpath(pkgdir(REPL),"test","FakeTer
if jlcon_mode
input_string = "\e[200~$s\e[201~"
end
haderror = false
REPL.activate(mockrepl.mockdule)
# this allows us to detect errors in the middle of non-jlcon files
if !jlcon_mode
od = Base.active_repl.interface.modes[1].on_done
Base.active_repl.interface.modes[1].on_done = function (x...)
if Base.active_repl.waserror
haderror = true
end
od(x...)
end
end
result = redirect_stdout(mockrepl.out_stream) do
input_task = @async begin
write(mockrepl.stdin_write, input_string)
Expand All @@ -175,8 +186,16 @@ isdefined(Main, :FakeTerminals) || include(joinpath(pkgdir(REPL),"test","FakeTer
wait(input_task)
readuntil(mockrepl.output.out, "\nEND_BLOCK")
end
if !jlcon_mode
# restore on-done
Base.active_repl.interface.modes[1].on_done=od
end
REPL.activate(Main)
return sanitize_output(result)
output = sanitize_output(result)
if !jlcon_mode && haderror
error("ERROR in jl-mode:\n", output)
end
return output
end

function test_chapter(chapter::String="")
Expand Down
Loading