<commit_before>package convert

import (
	"github.com/stretchr/testify/require"
	"testing"
)

func TestToBool(t *testing.T) {
	v, err := ToBool("true")
	require.Nil(t, err)
	require.Equal(t, true, v)

	v, err = ToBool("1")
	require.Nil(t, err)
	require.Equal(t, true, v)

	v, err = ToBool("0")
	require.Nil(t, err)
	require.Equal(t, false, v)

	v, err = ToBool("false")
	require.Nil(t, err)
	require.Equal(t, false, v)

	v, err = ToBool("dsds3wr")
	require.NotNil(t, err)
}

func TestToInt(t *testing.T) {
	v, err := ToInt("1")
	require.Nil(t, err)
	require.Equal(t, 1, v)

	v, err = ToInt("-1")
	require.Nil(t, err)
	require.Equal(t, -1, v)

	v, err = ToInt("12345.12345")
	require.NotNil(t, err)

	v, err = ToInt("fgfert3")
	require.NotNil(t, err)
}

func TestToFloat(t *testing.T) {
	v, err := ToFloat("1")
	require.Nil(t, err)
	require.Equal(t, 1.0, v)

	v, err = ToFloat("-1")
	require.Nil(t, err)
	require.Equal(t, -1.0, v)

	v, err = ToFloat("12345.12345")
	require.Nil(t, err)
	require.Equal(t, 12345.12345, v)

	v, err = ToFloat("fgfert3")
	require.NotNil(t, err)
}

func TestToDate(t *testing.T) {
	v, err := ToDate("43308.7047106481")
	require.Nil(t, err)
	require.Equal(t, "2018-07-27T11:54:46", v.Format(ISO8601))

	v, err = ToDate("2018-07-27T17:40:58")
	require.Nil(t, err)
	require.Equal(t, "2018-07-27T17:40:58", v.Format(ISO8601))

	v, err = ToDate("dsdsds")
	require.NotNil(t, err)
}<commit_msg>fixes for dates and local times<commit_after>package convert

import (
	"github.com/stretchr/testify/require"
	"testing"
)

func TestToBool(t *testing.T) {
	v, err := ToBool("true")
	require.Nil(t, err)
	require.Equal(t, true, v)

	v, err = ToBool("1")
	require.Nil(t, err)
	require.Equal(t, true, v)

	v, err = ToBool("0")
	require.Nil(t, err)
	require.Equal(t, false, v)

	v, err = ToBool("false")
	require.Nil(t, err)
	require.Equal(t, false, v)

	v, err = ToBool("dsds3wr")
	require.NotNil(t, err)
}

func TestToInt(t *testing.T) {
	v, err := ToInt("1")
	require.Nil(t, err)
	require.Equal(t, 1, v)

	v, err = ToInt("-1")
	require.Nil(t, err)
	require.Equal(t, -1, v)

	v, err = ToInt("12345.12345")
	require.NotNil(t, err)

	v, err = ToInt("fgfert3")
	require.NotNil(t, err)
}

func TestToFloat(t *testing.T) {
	v, err := ToFloat("1")
	require.Nil(t, err)
	require.Equal(t, 1.0, v)

	v, err = ToFloat("-1")
	require.Nil(t, err)
	require.Equal(t, -1.0, v)

	v, err = ToFloat("12345.12345")
	require.Nil(t, err)
	require.Equal(t, 12345.12345, v)

	v, err = ToFloat("fgfert3")
	require.NotNil(t, err)
}

func TestToDate(t *testing.T) {
	v, err := ToDate("43308.7047106481")
	require.Nil(t, err)
	require.Equal(t, "2018-07-27 16:54:46 +0000 UTC", v.UTC().String())

	v, err = ToDate("2018-07-27T17:40:58")
	require.Nil(t, err)
	require.Equal(t, "2018-07-27 17:40:58 +0000 UTC", v.UTC().String())

	v, err = ToDate("dsdsds")
	require.NotNil(t, err)
}
{'fraction_non_alphanumeric': 0.20391061452513967, 'fraction_numerical': 0.07681564245810056, 'mean_word_length': 4.171480144404332, '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': '1361472', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1303, 'n_words': 271}