[GH-ISSUE #18] Use fakewidget.Draw in tests that use the fake widget #18

Closed
opened 2026-03-03 16:21:42 +03:00 by kerem · 0 comments
Owner

Originally created by @mum4k on GitHub (Apr 21, 2018).
Original GitHub issue: https://github.com/mum4k/termdash/issues/18

All tests that use the fake widget should use fakewidget.Draw or fakewidget.MustDraw when creating the expected value.

That way changes or enhancements to fakewidget will be limited to that package.

This is an example of a test that doesn't use MustDraw and instead uses primitives directly (MustBorder, MustText):
github.com/mum4k/termdash@f72f1c2fa8/container/draw_test.go (L67)

This is an example of a test that uses the desired helper instead of draw primitives:
github.com/mum4k/termdash@6b9ac6b0a5/termdash_test.go (L168)

Originally created by @mum4k on GitHub (Apr 21, 2018). Original GitHub issue: https://github.com/mum4k/termdash/issues/18 All tests that use the fake widget should use fakewidget.Draw or fakewidget.MustDraw when creating the expected value. That way changes or enhancements to fakewidget will be limited to that package. This is an example of a test that doesn't use MustDraw and instead uses primitives directly (MustBorder, MustText): https://github.com/mum4k/termdash/blob/f72f1c2fa8f91e7866db6ae93ae721b357075c2d/container/draw_test.go#L67 This is an example of a test that uses the desired helper instead of draw primitives: https://github.com/mum4k/termdash/blob/6b9ac6b0a54315fba5857ef0f2d900ff63b98c94/termdash_test.go#L168
kerem 2026-03-03 16:21:42 +03:00
  • closed this issue
  • added the
    cleanup
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#18
No description provided.