From 5384756d6483ba4bda294d47461c8df8b25c7a9c Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Fri, 10 Mar 2017 23:10:15 +0800 Subject: - Complete the element `sheetFormatPr` struct definition; - Partial logic performance optimization, use pointer reference instead of a pass the variable value; - Add comments for content types struct definition; - Update go test `TestSetBorder` section --- excelize_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'excelize_test.go') diff --git a/excelize_test.go b/excelize_test.go index 494156b..e4892e6 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -283,12 +283,15 @@ func TestSetBorder(t *testing.T) { t.Log(err) } // Test set border with invalid style index number. - err = xlsx.SetBorder("Sheet1", "J21", "L25", "") + err = xlsx.SetBorder("Sheet1", "J21", "L25", `{"border":[{"type":"left","color":"0000FF","style":-1},{"type":"top","color":"00FF00","style":14},{"type":"bottom","color":"FFFF00","style":5},{"type":"right","color":"FF0000","style":6},{"type":"diagonalDown","color":"A020F0","style":9},{"type":"diagonalUp","color":"A020F0","style":8}]}`) + if err != nil { + t.Log(err) + } if err != nil { t.Log(err) } // Test set border on overlapping area. - err = xlsx.SetBorder("Sheet1", "J21", "L25", `{"border":[{"type":"left","color":"0000FF","style":-1},{"type":"top","color":"00FF00","style":14},{"type":"bottom","color":"FFFF00","style":5},{"type":"right","color":"FF0000","style":6},{"type":"diagonalDown","color":"A020F0","style":9},{"type":"diagonalUp","color":"A020F0","style":8}]}`) + err = xlsx.SetBorder("Sheet1", "J21", "L25", `{"border":[{"type":"left","color":"0000FF","style":2},{"type":"top","color":"00FF00","style":12},{"type":"bottom","color":"FFFF00","style":5},{"type":"right","color":"FF0000","style":6},{"type":"diagonalDown","color":"A020F0","style":9},{"type":"diagonalUp","color":"A020F0","style":8}]}`) if err != nil { t.Log(err) } -- cgit v1.2.1