Skip to content

Add unit tests for lookups._cut #73

Description

@ldbumble

_cut in taskuary/lookups.py trims every look-up's text before the Assistant reads it. It is pure, used everywhere, and has no test of its own.

Done when a new CutTests class in tests/test_lookups.py pins its behaviour:

  • below 600 characters, whitespace and newlines collapse to single spaces;
  • at 600 or more, the text keeps its own lines;
  • a string exactly n long is not cut;
  • a longer one ends with […];
  • None gives ''.

No code change expected - if a test shows the function doing something surprising, say so in the PR.


Getting started: pip install -e ".[dev]", then python -m pytest -q (offline, a few seconds). UI work: cd website && npm ci && npm test. See CONTRIBUTING.md. One small PR with the change and its test is perfect.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions