Skip to content

Add a few more test cases #320

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

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Add a few more test cases #320

merged 1 commit into from
Jan 8, 2025

Conversation

meowgorithm
Copy link
Member

@meowgorithm meowgorithm commented Jan 7, 2025

I added a couple more test cases here as I was curious to see how Cut behaves.

One minor question: if the size of the cut is zero, should we just return the empty string? This is how it currently works:

Cut(\x1b[7mHello\x1b[m", 2, 2) == "\x1b[7m\x1b[m" // true

Update: after seeing charmbracelet/lipgloss#458 I would suggest we do but the extra check in to not render unnecessary ANSI.

@meowgorithm meowgorithm requested a review from caarlos0 January 7, 2025 14:35
@meowgorithm meowgorithm changed the title Add a few couple more test cases Add a few more test cases Jan 7, 2025
@meowgorithm meowgorithm merged commit 18c3144 into main Jan 8, 2025
8 checks passed
@meowgorithm meowgorithm deleted the cut-tests branch January 8, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants