<commit_before>package bitmap

import (
	"reflect"
	"testing"

	"github.com/facebookgo/ensure"
)

// -----------------------------------------------------------------------------

func TestFlatten_singleValue_int(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(int(50))},
	}
	ensure.Subset(t, Flatten(int(50)), subset)
}

func TestFlatten_singleValue_int8(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(int8(50))},
	}
	ensure.Subset(t, Flatten(int8(50)), subset)
}

func TestFlatten_singleValue_int16(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(int16(50))},
	}
	ensure.Subset(t, Flatten(int16(50)), subset)
}

func TestFlatten_singleValue_int32(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(int32(50))},
	}
	ensure.Subset(t, Flatten(int32(50)), subset)
}

func TestFlatten_singleValue_int64(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(int64(50))},
	}
	ensure.Subset(t, Flatten(int64(50)), subset)
}

func TestFlatten_singleValue_uint(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(uint(50))},
	}
	ensure.Subset(t, Flatten(uint(50)), subset)
}

func TestFlatten_singleValue_uint8(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(uint8(50))},
	}
	ensure.Subset(t, Flatten(uint8(50)), subset)
}

func TestFlatten_singleValue_uint16(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(uint16(50))},
	}
	ensure.Subset(t, Flatten(uint16(50)), subset)
}

func TestFlatten_singleValue_uint32(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(uint32(50))},
	}
	ensure.Subset(t, Flatten(uint32(50)), subset)
}

func TestFlatten_singleValue_uint64(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(uint64(50))},
	}
	ensure.Subset(t, Flatten(uint64(50)), subset)
}

func TestFlatten_singleValue_float32(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(float32(50.20))},
	}
	ensure.Subset(t, Flatten(float32(50.20)), subset)
}

func TestFlatten_singleValue_float64(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(float64(50.20))},
	}
	ensure.Subset(t, Flatten(float64(50.20)), subset)
}

func TestFlatten_singleValue_complex64(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(complex64(50))},
	}
	ensure.Subset(t, Flatten(complex64(50)), subset)
}

func TestFlatten_singleValue_complex128(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(complex128(50))},
	}
	ensure.Subset(t, Flatten(complex128(50)), subset)
}

func TestFlatten_singleValue_ptr(t *testing.T) {
	subset := [][]interface{}{
		{reflect.ValueOf(int(50))},
	}

	ensure.Subset(t, Flatten(int(50)), subset)
}

// -----------------------------------------------------------------------------
<commit_msg>add generateSubset<commit_after>package bitmap

import (
	"reflect"
	"testing"

	"github.com/facebookgo/ensure"
)

// -----------------------------------------------------------------------------

// TODO
func generateSubset(iface interface{}) [][]interface{} {
	subset := [][]interface{}{
		{reflect.ValueOf(iface)},
	}
	return subset
}

// -----------------------------------------------------------------------------

func TestFlatten_singleValue_int(t *testing.T) {
	ensure.Subset(t, Flatten(int(50)), generateSubset(int(50)))
}

func TestFlatten_singleValue_int8(t *testing.T) {
	ensure.Subset(t, Flatten(int8(8)), generateSubset(int8(8)))
}

func TestFlatten_singleValue_int16(t *testing.T) {
	ensure.Subset(t, Flatten(int16(16)), generateSubset(int16(16)))
}

func TestFlatten_singleValue_int32(t *testing.T) {
	ensure.Subset(t, Flatten(int32(32)), generateSubset(int32(32)))
}

func TestFlatten_singleValue_int64(t *testing.T) {
	ensure.Subset(t, Flatten(int64(64)), generateSubset(int64(64)))
}

func TestFlatten_singleValue_uint(t *testing.T) {
	ensure.Subset(t, Flatten(uint(50)), generateSubset(uint(50)))
}

func TestFlatten_singleValue_uint8(t *testing.T) {
	ensure.Subset(t, Flatten(uint8(8)), generateSubset(uint8(8)))
}

func TestFlatten_singleValue_uint16(t *testing.T) {
	ensure.Subset(t, Flatten(uint16(16)), generateSubset(uint16(16)))
}

func TestFlatten_singleValue_uint32(t *testing.T) {
	ensure.Subset(t, Flatten(uint32(32)), generateSubset(uint32(32)))
}

func TestFlatten_singleValue_uint64(t *testing.T) {
	ensure.Subset(t, Flatten(uint64(64)), generateSubset(uint64(64)))
}

func TestFlatten_singleValue_float32(t *testing.T) {
	ensure.Subset(t, Flatten(float32(50.32)), generateSubset(float32(50.32)))
}

func TestFlatten_singleValue_float64(t *testing.T) {
	ensure.Subset(t, Flatten(float64(50.64)), generateSubset(float64(50.64)))
}

func TestFlatten_singleValue_complex64(t *testing.T) {
	ensure.Subset(t, Flatten(complex64(64)), generateSubset(complex64(64)))
}

func TestFlatten_singleValue_complex128(t *testing.T) {
	ensure.Subset(t, Flatten(complex128(128)), generateSubset(complex128(128)))
}

func TestFlatten_singleValue_ptr(t *testing.T) {
	ensure.Subset(t, Flatten(int(50)), generateSubset(int(50)))
}

// -----------------------------------------------------------------------------

{'fraction_non_alphanumeric': 0.2439072327044025, 'fraction_numerical': 0.05345911949685535, 'mean_word_length': 4.156028368794326, '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': '880186', 'n_tokens_mistral': 2006, 'n_tokens_neox': 1856, 'n_words': 248}