gap-packages / JupyterKernel

Native Jupyter kernel for GAP
https://gap-packages.github.io/JupyterKernel/
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

Loading JupyterKernel breaks tst/testextra/helpsys.tst #67

Closed olexandr-konovalov closed 6 years ago

olexandr-konovalov commented 6 years ago

In the test log:

########> Diff in /circa/scratch/gap-jenkins/workspace/GAP-pkg-update-stable-q\
uicktest/GAPCOPTS/64build/GAPGMP/gmp/GAPTARGET/standard/label/kovacs/GAP-pkg-u\
pdate-stable-snapshot/tst/testextra/helpsys.tst:21
# Input is:
HELP(":?");
# Expected output:
# But found:
Error, Function Calls: <func> must return a value
########

In GAP session, to show the backtrace:

gap> HELP(":?");
Error, Function Calls: <func> must return a value in
  return HELP_VIEWER_INFO.(viewer).show( 
   [ book.bookname, StripEscapeSequences( book.entries[entrynr][1] ), data ] )
 ; at /Users/alexk/Library/Preferences/GAP/pkg/JupyterKernel/gap/JupyterHelp.g\
i:75 called from 
GET_HELP_URL( i 
 ) at /Users/alexk/Library/Preferences/GAP/pkg/JupyterKernel/gap/JupyterHelp.g\
i:128 called from
HELP_SHOW_MATCHES( books, str, false 
 ) at /Users/alexk/Library/Preferences/GAP/pkg/JupyterKernel/gap/JupyterHelp.g\
i:260 called from
<function "HELP">( <arguments> )
 called from read-eval loop at *stdin*:9
you can supply one by 'return <value>;'
brk>
olexandr-konovalov commented 6 years ago

The test sets SetHelpViewer("screen"); and we have

gap> Print(HELP_VIEWER_INFO.("screen").show);
function ( lines )
    if UserPreference( "Pager" ) = "builtin" then
        if IsRecord( lines ) then
            lines.exitAtEnd := false;
        else
            lines := rec(
                lines := lines,
                exitAtEnd := false );
        fi;
        PAGER_BUILTIN( lines );
    else
        PAGER_EXTERNAL( lines );
    fi;
    return;
end
olexandr-konovalov commented 6 years ago

Fixed in https://github.com/gap-packages/JupyterKernel/commit/4673bfb7f6b11291820fe699404a9324063c63e0 and https://github.com/gap-packages/JupyterKernel/commit/df85be89246efff044dd180185d9eadc53953b9e