Replies: 4 comments 3 replies
-
Надо рефакторить код фара чтоб он воспринимал терминал не как сетку wchar-ов, а учитывал длину строки в каждом конкретном месте. А хаки типа #1279 добавлять не хочется. |
Beta Was this translation helpful? Give feedback.
-
@elfmz для автоматизированного тестирования интерактивных консольных приложений есть тулза
Можно подумать о неком конвертере макросов фара в expect-скрипты для упрощения подготовки тестов, это должно быть несложно. Возможно, понадобится чутка доработать сам макро-рекордер, чтоб он в каменты макросов сохранял характерные строки для expect'а (например, можно после каждого нажатия клавиши сохранять в камент макроса первый найденный в экранном буфере текстовый фрагмент, отсутствовавший на экране до нажатия клавиши). |
Beta Was this translation helpful? Give feedback.
-
Сделал небольшой патчик к far2l, позволяющий при записи макроса одновременно создавать скрипт для При этом уже получается записывать вполне работающие скрипты, пример ниже.
А вот пример записанного скрипта (шапка и хвост вручную добавлены):
Для понимания, вот эквивалентный key_macros.ini
|
Beta Was this translation helpful? Give feedback.
-
Можно сделать даже ещё изящнее: запускать фар внутри фара, и дублировать в файл все esc-последовательности ввода, генерируемые «внешним» фаром в ответ на нажатия клавиш в режиме far2l extensions. А потом при тестировании скармливать их фару через ту же expect. Так, по идее, можно вообще любые сочетания клавиш эмулировать, а не только доступные в обычных терминалках. Можно даже фиксировать интервалы времени между нажатиями, и вставлять в скрипты sleep, чтобы оно точь в точь по времени воспроизводилось. |
Beta Was this translation helpful? Give feedback.
-
Хорошо бы нам начать поддерживать диакритические (и вообще комбинированные) символы на уровне экранного буфера. То есть, уйти от концепции «1 ячейка экрана = 1 кодовая точка unicode». На самом деле, кодовых точек юникода на ячейку может быть сколько угодно. А вот как бы такое устроить без серьезного проседания производительности?
Работает же это во всяких терминалках юникодных как-то — mc в GNOME Terminal нормально показывает файл
ÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀ.txt
, а вот far2l так не может.Beta Was this translation helpful? Give feedback.
All reactions