You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The display function uses the screen's events channel EventQ to simulate input, is this the correct way to do it?
Should I use vt.MockTerm.KeyEvent instead?
The getCells funcion basically calls tty.GetCells in a loop, for every cell in the grid.
I looked at the hello_test.go and there's several things I don't understand. For example, why calling time.Sleep required? That looks weird.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello, I developed a simple toy application for typing practice:
https://gitlab.com/itaranto/typo
I developed it using
tcell/v2. I usedtcell.SimulationScreenfor the unit tests.That worked great because I could test my main loop function that looks like this:
And using a test body that looks like this:
Here
simulateScreenmakes use ofSimulationScreen.InjectKeyto simulate key inputThis kind of test allows me to precisely assert the displayed cells on the terminal.
Now I want to migrate to
tcell/v3butSimulationScreenwas removed in favor ofvt.MockTermif I understand correctly.The problem is that I cannot make
vt.MockTerm.GetCellto work, I'm not being able to see the actual cells written bytcell.Screen.Show.Here's my attempt:
The
displayfunction uses the screen's events channelEventQto simulate input, is this the correct way to do it?Should I use
vt.MockTerm.KeyEventinstead?The
getCellsfuncion basically callstty.GetCellsin a loop, for every cell in the grid.I looked at the hello_test.go and there's several things I don't understand. For example, why calling
time.Sleeprequired? That looks weird.What am I doing wrong?
All reactions