remove livelock
This commit is contained in:
parent
cacd21f840
commit
55577201a4
2 changed files with 3 additions and 1 deletions
|
@ -72,7 +72,7 @@ func getClaimNameFromTitle(title string, attempt int) string {
|
|||
|
||||
name := chunks[0]
|
||||
if len(name) > maxLen {
|
||||
return truncateUnicode(name, maxLen)
|
||||
return truncateUnicode(name, maxLen) + suffix
|
||||
}
|
||||
|
||||
for _, chunk := range chunks[1:] {
|
||||
|
|
|
@ -21,4 +21,6 @@ func Test_getClaimNameFromTitle(t *testing.T) {
|
|||
assert.Equal(t, "test", name)
|
||||
name = getClaimNameFromTitle("『あなたはただの空の殻でした』", 0)
|
||||
assert.Equal(t, "『あなたはただの空の殻でした』", name)
|
||||
name = getClaimNameFromTitle("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 50)
|
||||
assert.Equal(t, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-50", name)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue