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

err: Test_terminal_vt420 #14595

Closed
Shane-XB-Qian opened this issue Apr 19, 2024 · 12 comments
Closed

err: Test_terminal_vt420 #14595

Shane-XB-Qian opened this issue Apr 19, 2024 · 12 comments
Labels

Comments

@Shane-XB-Qian
Copy link
Contributor

Steps to reproduce

Q:

Test_terminal_vt420[10]..WaitForAssert[2]..<SNR>4_WaitForCommon[11]..<lambda>152 line 1: Pattern 't_xo=y' does not match

A:

'vt420' not known. Available builtin terminals are:
    builtin_ansi
    builtin_vt320
    builtin_vt52
    builtin_xterm
    builtin_iris-ansi
    builtin_pcansi
    builtin_win32
    builtin_amiga
    builtin_dumb
    builtin_debug

#14542 @ant0sha

Expected behaviour

no err

Version of Vim

9.1.354

Environment

linux

Logs and stack traces

No response

@zeertzjq
Copy link
Member

The error message in the Q: part seem incomplete.

@Shane-XB-Qian
Copy link
Contributor Author

Shane-XB-Qian commented Apr 19, 2024 via email

@chrisbra
Copy link
Member

So where is your terminfo? do you have vt420 in there?

@jamessan
Copy link
Contributor

You may need to install an additional package to get the vt420 term definition (e.g., in Debian it's the ncurses-term package).

@Shane-XB-Qian
Copy link
Contributor Author

Shane-XB-Qian commented Apr 30, 2024 via email

@chrisbra
Copy link
Member

Hm, but ncurses-term depends on ncurses-base which is an essential package. So I would think one can expect it to be there. In any case, I don't think it makes sense to keep this issue open.

@chrisbra chrisbra closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
@Shane-XB-Qian
Copy link
Contributor Author

Shane-XB-Qian commented Apr 30, 2024 via email

@chrisbra
Copy link
Member

yes, but it depends on an essential package. Unless you mess with the dependencies, you should have it. In any case, it seems like an issue with that particular environment

@Shane-XB-Qian
Copy link
Contributor Author

Shane-XB-Qian commented Apr 30, 2024 via email

@jamessan
Copy link
Contributor

yes, but it depends on an essential package. Unless you mess with the dependencies, you should have it.

You have it reversed. ncurses-base is essential, so it will be installed. ncurses-term provides additional, less frequently needed definitions, so it may not be installed.

Not sure if there's a better way to check for the term definition (or how portable it is, especially on the BSDs), but one possibility is to only run the test if infocmp vt420 has a successful exit status.

@chrisbra
Copy link
Member

chrisbra commented Apr 30, 2024

You have it reversed.

Indeed.

So I guess we need something along those lines here:

diff --git a/src/testdir/test_terminal3.vim b/src/testdir/test_terminal3.vim
index 223bcc537..588a9e010 100644
--- a/src/testdir/test_terminal3.vim
+++ b/src/testdir/test_terminal3.vim
@@ -935,6 +935,12 @@ func Test_terminal_vt420()
   CheckRunVimInTerminal
   " For Termcap
   CheckUnix
+  let a = system('infocmp vt420')
+  if v:shell_error
+    " reset v:shell_error
+    let a=system('true')
+    throw 'Skipped: vt420 terminfo not available'
+  endif
   let rows=15
   call writefile([':set term=vt420'], 'Xterm420', 'D')

@Shane-XB-Qian
Copy link
Contributor Author

Shane-XB-Qian commented Apr 30, 2024 via email

chrisbra added a commit to chrisbra/vim that referenced this issue Apr 30, 2024
Problem:  vt420 terminfo entry not found
Solution: check existence of terminfo vt420 and infocmp command

related: vim#14595

Signed-off-by: Christian Brabandt <cb@256bit.org>
chrisbra added a commit to chrisbra/vim that referenced this issue Apr 30, 2024
Problem:  vt420 terminfo entry not found
Solution: check existence of terminfo vt420 and infocmp command

related: vim#14595

Signed-off-by: Christian Brabandt <cb@256bit.org>
chrisbra added a commit that referenced this issue Apr 30, 2024
Problem:  tests: vt420 terminfo entry may not be found
          (Shane-XB-Qian)
Solution: check existence of terminfo vt420 and infocmp command

related: #14595
closes: #14677

Signed-off-by: Christian Brabandt <cb@256bit.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants