<commit_before>// Copyright 2019 by caixw, All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.

package core

import (
	"reflect"
	"testing"

	"github.com/issue9/assert"
)

func TestColumn_IsZero(t *testing.T) {
	a := assert.New(t)

	col, err := NewColumnFromGoType(IntType)
	a.NotError(err).NotNil(col)
	a.True(col.IsZero(reflect.ValueOf(int(0))))
	a.False(col.IsZero(reflect.ValueOf(1)))

	col, err = NewColumnFromGoType(reflect.TypeOf([]byte{}))
	a.NotError(err).NotNil(col)
	a.True(col.IsZero(reflect.ValueOf([]byte{})))
	a.True(col.IsZero(reflect.ValueOf([]byte(""))))
	a.False(col.IsZero(reflect.ValueOf([]byte{'0'})))

	col, err = NewColumnFromGoType(RawBytesType)
	a.NotError(err).NotNil(col)
	a.True(col.IsZero(reflect.ValueOf([]byte{})))
	a.True(col.IsZero(reflect.ValueOf([]byte(""))))
	a.False(col.IsZero(reflect.ValueOf([]byte{'0'})))
	a.False(col.IsZero(reflect.ValueOf(1)))

	col, err = NewColumnFromGoType(reflect.TypeOf(func() {}))
	a.ErrorType(err, ErrInvalidColumnType).Nil(col)
}

func TestColumn_Clone(t *testing.T) {
	a := assert.New(t)
<commit_msg>test: 修正测试错误<commit_after>// Copyright 2019 by caixw, All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.

package core

import (
	"testing"

	"github.com/issue9/assert"
)

func TestColumn_Clone(t *testing.T) {
	a := assert.New(t)

{'fraction_non_alphanumeric': 0.17200557103064068, 'fraction_numerical': 0.010445682451253482, 'mean_word_length': 5.220779220779221, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5857899', 'n_tokens_mistral': 558, 'n_tokens_neox': 550, 'n_words': 107}