Skip to content

Commit

Permalink
Rename test TestSetLongUtf8CellValues to TestSetCellValuesMultiByte w…
Browse files Browse the repository at this point in the history
…ith a bit of refactor it
  • Loading branch information
IAkumaI committed Apr 10, 2023
1 parent 3eccb7f commit 141e06a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,16 @@ func TestSetCellFloat(t *testing.T) {
assert.EqualError(t, f.SetCellFloat("Sheet:1", "A1", 123.42, -1, 64), ErrSheetNameInvalid.Error())
}

func TestSetLongUtf8CellValues(t *testing.T) {
func TestSetCellValuesMultiByte(t *testing.T) {
value := strings.Repeat("\u042B", TotalCellChars+1)

f := NewFile()
long_value := strings.Repeat("Ы", TotalCellChars+1)
err := f.SetCellValue("Sheet1", "A1", long_value)
err := f.SetCellValue("Sheet1", "A1", value)
assert.NoError(t, err)

v, err := f.GetCellValue("Sheet1", "A1")
assert.NoError(t, err)
assert.NotEqual(t, long_value, v)
assert.NotEqual(t, value, v)
assert.Equal(t, TotalCellChars, len([]rune(v)))
}

Expand Down

0 comments on commit 141e06a

Please sign in to comment.