<commit_before>package mergo

import (
	"testing"
	"time"
)

type structWithoutTimePointer struct {
	Created time.Time
}

func TestIssue38Merge(t *testing.T) {
	dst := structWithoutTimePointer{
		time.Now(),
	}

	expected := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
	src := structWithoutTimePointer{
		expected,
	}
	if err := Merge(&dst, src); err != nil {
		t.Errorf("Error while merging %s", err)
	}
	if dst.Created != src.Created {
		t.Fatalf("Created not merged in properly: dst.Created(%v) != src.Created(%v)", dst.Created, src.Created)
	}
}

func TestIssue38MergeWithOverwrite(t *testing.T) {
	dst := structWithoutTimePointer{
		time.Now(),
	}

	expected := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
	src := structWithoutTimePointer{
		expected,<commit_msg>Fixing test<commit_after>package mergo

import (
	"testing"
	"time"
)

type structWithoutTimePointer struct {
	Created time.Time
}

func TestIssue38Merge(t *testing.T) {
	dst := structWithoutTimePointer{
		time.Now(),
	}

	expected := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
	src := structWithoutTimePointer{
		expected,
	}
	if err := Merge(&dst, src); err != nil {
		t.Errorf("Error while merging %s", err)
	}
	if dst.Created == src.Created {
		t.Fatalf("Created merged unexpectedly: dst.Created(%v) == src.Created(%v)", dst.Created, src.Created)
	}
}

func TestIssue38MergeEmptyStruct(t *testing.T) {
	dst := structWithoutTimePointer{
	}

	expected := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
	src := structWithoutTimePointer{
		expected,
	}
	if err := Merge(&dst, src); err != nil {
		t.Errorf("Error while merging %s", err)
	}
	if dst.Created == src.Created {
		t.Fatalf("Created merged unexpectedly: dst.Created(%v) == src.Created(%v)", dst.Created, src.Created)
	}
}

func TestIssue38MergeWithOverwrite(t *testing.T) {
	dst := structWithoutTimePointer{
		time.Now(),
	}

	expected := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
	src := structWithoutTimePointer{
		expected,
{'fraction_non_alphanumeric': 0.15464426877470355, 'fraction_numerical': 0.032114624505928856, 'mean_word_length': 4.443548387096774, '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': '3658631', 'n_tokens_mistral': 804, 'n_tokens_neox': 716, 'n_words': 174}