summaryrefslogtreecommitdiff
path: root/errors_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'errors_test.go')
-rw-r--r--errors_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/errors_test.go b/errors_test.go
new file mode 100644
index 0000000..89d241c
--- /dev/null
+++ b/errors_test.go
@@ -0,0 +1,21 @@
+package excelize
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestNewInvalidColNameError(t *testing.T) {
+ assert.EqualError(t, newInvalidColumnNameError("A"), "invalid column name \"A\"")
+ assert.EqualError(t, newInvalidColumnNameError(""), "invalid column name \"\"")
+}
+
+func TestNewInvalidRowNumberError(t *testing.T) {
+ assert.EqualError(t, newInvalidRowNumberError(0), "invalid row number 0")
+}
+
+func TestNewInvalidCellNameError(t *testing.T) {
+ assert.EqualError(t, newInvalidCellNameError("A"), "invalid cell name \"A\"")
+ assert.EqualError(t, newInvalidCellNameError(""), "invalid cell name \"\"")
+}