Explorar o código

add test case

bronze1man %!s(int64=12) %!d(string=hai) anos
pai
achega
6170a5f014
Modificáronse 2 ficheiros con 13 adicións e 2 borrados
  1. BIN=BIN
      wpsBlankLineTest.xlsx
  2. 13 2
      wpsBlankLine_test.go

BIN=BIN
wpsBlankLineTest.xlsx


+ 13 - 2
wpsBlankLine_test.go

@@ -22,14 +22,25 @@ func TestWpsBlankLine(t *testing.T) {
 	s := cell.String()
 	expected := "编号"
 	if s != expected {
-		t.Errorf("[TestMacExcel] expected cell A1 = '%s'', but got :'%s'", expected, s)
+		t.Errorf("[TestMacExcel] expected cell A1 = '%s', but got :'%s'", expected, s)
 		return
 	}
 	row = sheet.Rows[2]
 	cell = row.Cells[0]
 	s = cell.String()
 	if s != expected {
-		t.Errorf("[TestMacExcel] expected cell A3 = '%s'', but got :'%s'", expected, s)
+		t.Errorf("[TestMacExcel] expected cell A3 = '%s', but got :'%s'", expected, s)
 		return
 	}
+  
+  s = sheet.Rows[4].Cells[1].String()
+	if s != "" {
+		t.Errorf("[TestMacExcel] expected cell B5 = '%s', but got :'%s'", "", s)
+		return
+	}  
+  s = sheet.Rows[4].Cells[2].String()
+	if s != expected {
+		t.Errorf("[TestMacExcel] expected cell C5 = '%s', but got :'%s'", expected, s)
+		return
+	}  
 }