Skip to content

Commit

Permalink
Merge pull request qax-os#280 from covv/search-sheet
Browse files Browse the repository at this point in the history
resolve qax-os#277 Add testing case for the function `SearchSheet()`
  • Loading branch information
xuri authored Oct 30, 2018
2 parents 61604d1 + be4b941 commit 950dd95
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions excelize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,19 @@ func TestHSL(t *testing.T) {
t.Log(RGBToHSL(250, 50, 100))
}

func TestSearchSheet(t *testing.T) {
xlsx, err := OpenFile("./test/SharedStrings.xlsx")
if err != nil {
t.Error(err)
return
}
// Test search in a not exists worksheet.
t.Log(xlsx.SearchSheet("Sheet4", ""))
// Test search a not exists value.
t.Log(xlsx.SearchSheet("Sheet1", "X"))
t.Log(xlsx.SearchSheet("Sheet1", "A"))
}

func trimSliceSpace(s []string) []string {
for {
if len(s) > 0 && s[len(s)-1] == "" {
Expand Down

0 comments on commit 950dd95

Please sign in to comment.