errors_test.go 812 B

12345678910111213141516171819202122232425
  1. package excelize
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestNewInvalidColNameError(t *testing.T) {
  7. assert.EqualError(t, newInvalidColumnNameError("A"), "invalid column name \"A\"")
  8. assert.EqualError(t, newInvalidColumnNameError(""), "invalid column name \"\"")
  9. }
  10. func TestNewInvalidRowNumberError(t *testing.T) {
  11. assert.EqualError(t, newInvalidRowNumberError(0), "invalid row number 0")
  12. }
  13. func TestNewInvalidCellNameError(t *testing.T) {
  14. assert.EqualError(t, newInvalidCellNameError("A"), "invalid cell name \"A\"")
  15. assert.EqualError(t, newInvalidCellNameError(""), "invalid cell name \"\"")
  16. }
  17. func TestNewInvalidExcelDateError(t *testing.T) {
  18. assert.EqualError(t, newInvalidExcelDateError(-1), "invalid date value -1.000000, negative values are not supported supported")
  19. }