mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #326] Example for writing a test using a simulated tcell.Screen #248
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#248
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Bios-Marcel on GitHub (Jul 23, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/326
I have been trying to write a test using tcell.SimulationScreen, but somehow I never reach a state where i can actually check the state. Instead it just times out after a while.
I have already tried manually invoking events on the
tview.Applicationinstance and thetcell.SimulationScreen, sadly that doesn't help either. I don't quite understand what's going on here. Am I missunderstanding something?This is my testcode:
And this the result:
@Bios-Marcel commented on GitHub (Jul 24, 2019):
So, I was pretty much doing an integration test of the app. What I found out you can do instead, is to draw the actual components onto a
tcell.SimulationScreendirectly. Obviously you won't have the EventLoop logic and so on, but you don't really wanna test tview itself, so that should be fine.