diff options
Diffstat (limited to 'src/testdir/test_vim9_import.vim')
-rw-r--r-- | src/testdir/test_vim9_import.vim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_import.vim b/src/testdir/test_vim9_import.vim index 19379a01aa..482e759d11 100644 --- a/src/testdir/test_vim9_import.vim +++ b/src/testdir/test_vim9_import.vim @@ -874,6 +874,37 @@ def Test_import_in_indentexpr() delete('Xindenter') enddef +func Test_import_in_printexpr() + CheckFeature postscript + call Run_Test_import_in_printexpr() +endfunc + +def Run_Test_import_in_printexpr() + var lines =<< trim END + vim9script + export def PrintFile(): bool + g:printed = 'yes' + delete('v:fname_in') + return false + enddef + END + writefile(lines, 'Xprint.vim') + + lines =<< trim END + vim9script + import './Xprint.vim' + set printexpr=Xprint.PrintFile() + END + CheckScriptSuccess(lines) + + help + hardcopy dummy args + assert_equal('yes', g:printed) + + delete('Xprint.vim') + set printexpr= +enddef + def Test_export_fails() CheckScriptFailure(['export var some = 123'], 'E1042:') CheckScriptFailure(['vim9script', 'export var g:some'], 'E1022:') |