diff options
| author | xuri <xuri.me@gmail.com> | 2018-12-30 00:18:34 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-30 00:18:34 +0800 |
| commit | 45ab95a4a118ed3ffa101cfe76eb8ba5c051aac5 (patch) | |
| tree | 5831d8dbf3418d4036bedc26c7ec8e41ba3d3f1c /cell_test.go | |
| parent | 9a6f66a996eb83f16da13416c5fca361afe575b0 (diff) | |
| parent | 35426ed5dc5196374332498c82b4d480b05e5ac5 (diff) | |
Merge pull request #323 from albenik/tests_fix
Tests refactoring
Diffstat (limited to 'cell_test.go')
| -rw-r--r-- | cell_test.go | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/cell_test.go b/cell_test.go index 4f9accd..cb3d80e 100644 --- a/cell_test.go +++ b/cell_test.go @@ -1,6 +1,10 @@ package excelize -import "testing" +import ( + "testing" + + "github.com/stretchr/testify/assert" +) func TestCheckCellInArea(t *testing.T) { expectedTrueCellInAreaList := [][2]string{ @@ -14,11 +18,8 @@ func TestCheckCellInArea(t *testing.T) { cell := expectedTrueCellInArea[0] area := expectedTrueCellInArea[1] - cellInArea := checkCellInArea(cell, area) - - if !cellInArea { - t.Fatalf("Expected cell %v to be in area %v, got false\n", cell, area) - } + assert.True(t, checkCellInArea(cell, area), + "Expected cell %v to be in area %v, got false\n", cell, area) } expectedFalseCellInAreaList := [][2]string{ @@ -31,10 +32,7 @@ func TestCheckCellInArea(t *testing.T) { cell := expectedFalseCellInArea[0] area := expectedFalseCellInArea[1] - cellInArea := checkCellInArea(cell, area) - - if cellInArea { - t.Fatalf("Expected cell %v not to be inside of area %v, but got true\n", cell, area) - } + assert.False(t, checkCellInArea(cell, area), + "Expected cell %v not to be inside of area %v, but got true\n", cell, area) } } |
