diff options
author | xuri <xuri.me@gmail.com> | 2018-12-26 14:48:14 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2018-12-26 14:48:14 +0800 |
commit | 9a6f66a996eb83f16da13416c5fca361afe575b0 (patch) | |
tree | c1d8fe12285df44f51edc1f3f453ab9cba41d71a /excelize_test.go | |
parent | 7b7ca99f5d570c30f7eee92c38c5e632b7815239 (diff) |
New feature: the function `SearchSheet` now support regular expression, relate pull request #316
Diffstat (limited to 'excelize_test.go')
-rw-r--r-- | excelize_test.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/excelize_test.go b/excelize_test.go index 8c19a3e..b1eb03a 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -1053,6 +1053,7 @@ func TestDuplicateRow(t *testing.T) { xlsx.SetCellStr(sheet, b1, bnValue) t.Run("FromSingleRow", func(t *testing.T) { + xlsx.DuplicateRow(sheet, -1) xlsx.DuplicateRow(sheet, 1) xlsx.DuplicateRow(sheet, 2) @@ -1333,19 +1334,9 @@ func TestSearchSheet(t *testing.T) { // Test search a not exists value. t.Log(xlsx.SearchSheet("Sheet1", "X")) t.Log(xlsx.SearchSheet("Sheet1", "A")) -} - -func TestRegSearchSheet(t *testing.T) { - xlsx, err := OpenFile("./test/Book1.xlsx") - if err != nil { - t.Error(err) - return - } - t.Log(xlsx.SearchSheet("Sheet1", "[0-9]")) - // Test search in a not exists worksheet. - t.Log(xlsx.SearchSheet("Sheet4", "")) - // Test search a not exists value. - t.Log(xlsx.SearchSheet("Sheet1", "")) + // Test search the coordinates where the numerical value in the range of + // "0-9" of Sheet1 is described by regular expression: + t.Log(xlsx.SearchSheet("Sheet1", "[0-9]", true)) } func TestProtectSheet(t *testing.T) { |