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

nothing is tested and that's kind of terrible #10

Open
lithp opened this issue Sep 11, 2021 · 1 comment
Open

nothing is tested and that's kind of terrible #10

lithp opened this issue Sep 11, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@lithp
Copy link
Owner

lithp commented Sep 11, 2021

what would it mean to test any of this? e.g. what should happen when the provider gives us an error?

@lithp lithp added the bug Something isn't working label Sep 11, 2021
@lithp
Copy link
Owner Author

lithp commented Sep 11, 2021

The template provided here makes testing look a lot easier than I was expecting. It's still not easy to embed colors in the tests while keeping them human-readable but that's a tooling issue.

With a little bit of factoring the UI can be turned into a pure function from UIState -> terminal buffer, or for more thorough testing it's probably preferable to factor into a pure function from a sequence of UIMessage -> terminal buffer. It should then be easy to write nice readable tests which turn some state (e.g. a block w no txns is selected) into expected terminal buffers.

Currently the entire screen is rendered every frame, though a casual reading of this makes it seem that moving to partial redraws won't require changing this test framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant