forked from tealeg/xlsx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestutil.go
30 lines (26 loc) · 991 Bytes
/
testutil.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package xlsx
import qt "github.com/frankban/quicktest"
// csRunC will run the given test function with all available
// CellStoreConstructors. You must take care of setting the
// CellStoreConstructors on the File struct or whereever else it is needed.
func csRunC(c *qt.C, description string, test func(c *qt.C, constructor CellStoreConstructor)) {
c.Run(description, func(c *qt.C) {
c.Run("MemoryCellStore", func(c *qt.C) {
test(c, NewMemoryCellStore)
})
c.Run("DiskVCellStore", func(c *qt.C) {
test(c, NewDiskVCellStore)
})
})
}
// csRunO will run the given test function with all available CellStore FileOptions, you must takes care of passing the FileOption to the appropriate method.
func csRunO(c *qt.C, description string, test func(c *qt.C, option FileOption)) {
c.Run(description, func(c *qt.C) {
c.Run("MemoryCellStore", func(c *qt.C) {
test(c, UseMemoryCellStore)
})
c.Run("DiskVCellStore", func(c *qt.C) {
test(c, UseDiskVCellStore)
})
})
}