gopkg/excel/read_test.go

55 lines
1.3 KiB
Go
Raw Normal View History

2021-11-23 16:33:01 +08:00
// Package excel...
//
// Description : excel...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2021-11-19 4:12 下午
package excel
import (
"fmt"
"testing"
)
// TestRead_GetAllData ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 4:12 下午 2021/11/19
func TestRead_GetAllData(t *testing.T) {
r, _ := NewRead("./test.xlsx", "")
fmt.Println(r.GetAllData())
}
// TestRead_GetAllDataToMap ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 4:12 下午 2021/11/19
func TestRead_GetAllDataToMap(t *testing.T) {
r, _ := NewRead("./test.xlsx", "")
fmt.Println(r.GetAllDataToMap([]string{"num1", "num2", "num3", "num4", "num5"}))
fmt.Println(r.GetAllDataToMap([]string{"num1", "num2"}))
}
// TestRead_ExtractAssignCol ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 4:12 下午 2021/11/19
func TestRead_ExtractAssignCol(t *testing.T) {
r, _ := NewRead("./test.xlsx", "")
fmt.Println(r.ExtractAssignCol([]int{0, 2, 8}))
}
// TestRead_ExtractAssignColToMap ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 4:12 下午 2021/11/19
func TestRead_ExtractAssignColToMap(t *testing.T) {
r, _ := NewRead("./test.xlsx", "")
fmt.Println(r.ExtractAssignColToMap(map[int]string{0: "num1", 2: "num3", 10: "num11"}))
}