Skip to content

Fixed truncation issue - #77

Merged
matrixik merged 1 commit into
gosimple:masterfrom
Aym3nTN:fix-truncate-issue
Oct 5, 2022
Merged

matrixik merged 1 commit into
gosimple:masterfrom
Aym3nTN:fix-truncate-issue

Conversation

@Aym3nTN

@Aym3nTN Aym3nTN commented Oct 5, 2022

Copy link
Copy Markdown
Contributor

#76
"
When trying to truncate a string with a value greater than its size, we get the below error.

Example of failed test: {"DOBROSLAWZYBORT", 17, "dobroslawzybort", false}

--- FAIL: TestSlugMakeSmartTruncate (0.01s)
panic: runtime error: slice bounds out of range [:17] with length 15 [recovered]
	panic: runtime error: slice bounds out of range [:17] with length 15

"

@codecov

codecov Bot commented Oct 5, 2022

Copy link
Copy Markdown

Codecov Report

Merging #77 (d046b02) into master (e79300e) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #77   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          142       142           
=========================================
  Hits           142       142           
Impacted Files Coverage Δ
slug.go 100.00% <100.00%> (ø)

@matrixik matrixik added the bug label Oct 5, 2022
@matrixik

matrixik commented Oct 5, 2022

Copy link
Copy Markdown
Member

And here I though that I added enough new test cases.
Thank you for finding and fixing it.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址