Test the plain text fields in CompletionItem.
()
| 951 | |
| 952 | |
| 953 | def test_plain_fields() -> None: |
| 954 | """Test the plain text fields in CompletionItem.""" |
| 955 | display = "\x1b[31mApple\x1b[0m" |
| 956 | display_meta = "\x1b[32mA tasty apple\x1b[0m" |
| 957 | |
| 958 | # Show that the plain fields remove the ANSI sequences. |
| 959 | completion_item = CompletionItem("apple", display=display, display_meta=display_meta) |
| 960 | assert completion_item.display == display |
| 961 | assert completion_item.display_plain == "Apple" |
| 962 | assert completion_item.display_meta == display_meta |
| 963 | assert completion_item.display_meta_plain == "A tasty apple" |
| 964 | |
| 965 | |
| 966 | def test_clean_display() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…