@@ -25,8 +25,8 @@ import (
25
25
"github.com/stretchr/testify/require"
26
26
)
27
27
28
- var testLongStr1 string = getLongString ("平p凯k星x辰c " )
29
- var testLongStr2 string = getLongString ("123aa啊啊aa " )
28
+ var testLongStr1 string = getLongString ("平352p凯额6辰c " )
29
+ var testLongStr2 string = getLongString ("123a啊f24f去rsgvsfg " )
30
30
31
31
func getChunk () * chunk.Chunk {
32
32
fieldTypes := make ([]* types.FieldType , 1 )
@@ -746,13 +746,15 @@ func TestPartialResult4SumFloat64(t *testing.T) {
746
746
747
747
func TestBasePartialResult4GroupConcat (t * testing.T ) {
748
748
var serializeHelper = NewSerializeHelper ()
749
+ serializeHelper .buf = make ([]byte , 0 )
749
750
bufSizeChecker := newBufferSizeChecker ()
750
751
751
752
// Initialize test data
752
753
expectData := []basePartialResult4GroupConcat {
754
+ {valsBuf : bytes .NewBufferString ("123" ), buffer : nil },
753
755
{valsBuf : bytes .NewBufferString ("" ), buffer : bytes .NewBufferString ("" )},
754
- {valsBuf : bytes .NewBufferString ("xzxx " ), buffer : bytes .NewBufferString (testLongStr2 )},
755
- {valsBuf : bytes .NewBufferString (testLongStr1 ), buffer : bytes .NewBufferString (testLongStr2 )},
756
+ {valsBuf : bytes .NewBufferString ("" ), buffer : bytes .NewBufferString (testLongStr1 )},
757
+ {valsBuf : bytes .NewBufferString ("" ), buffer : bytes .NewBufferString (testLongStr2 )},
756
758
}
757
759
serializedPartialResults := make ([]PartialResult , len (expectData ))
758
760
testDataNum := len (serializedPartialResults )
@@ -787,8 +789,11 @@ func TestBasePartialResult4GroupConcat(t *testing.T) {
787
789
// Check some results
788
790
require .Equal (t , testDataNum , index )
789
791
for i := 0 ; i < testDataNum ; i ++ {
790
- require .Equal (t , (* basePartialResult4GroupConcat )(serializedPartialResults [i ]).valsBuf .String (), deserializedPartialResults [i ].valsBuf .String ())
791
- require .Equal (t , (* basePartialResult4GroupConcat )(serializedPartialResults [i ]).buffer .String (), deserializedPartialResults [i ].buffer .String ())
792
+ if (* basePartialResult4GroupConcat )(serializedPartialResults [i ]).buffer != nil {
793
+ require .Equal (t , (* basePartialResult4GroupConcat )(serializedPartialResults [i ]).buffer .String (), deserializedPartialResults [i ].buffer .String ())
794
+ } else {
795
+ require .Equal (t , (* bytes .Buffer )(nil ), deserializedPartialResults [i ].buffer )
796
+ }
792
797
}
793
798
}
794
799
0 commit comments