<commit_before>package main

import (
	"io/ioutil"
	"os"
	"path/filepath"
	"testing"
)

func TestMerge(t *testing.T) {
	a := Config{
		KeyFile:              "aid",
		DataFile:             "adata",
		FilteringCommand:     "afil",
		UnprotectiveCommands: []string{"new", "migrate"},
	}
	b := Config{
		KeyFile:              "bid",
		DataFile:             "bdata",
		FilteringCommand:     "bfil",
		UnprotectiveCommands: []string{"remove"},
	}
	x := a.Merge(b)
	if x.KeyFile != "bid" {
		t.Errorf("KeyFile should be 'bid', but got %s", x.KeyFile)
	}
	if x.DataFile != "bdata" {
		t.Errorf("DataFile should be 'bdata', but got %s", x.DataFile)
	}
	if x.FilteringCommand != "bfil" {
		t.Errorf("FilteringCommand should be 'bfil', but got %s", x.FilteringCommand)
	}
	if len(x.UnprotectiveCommands) == 1 && x.UnprotectiveCommands[0] != "remove" {
		t.Errorf("UnprotectiveCommands should be overriden, but got %s", x.UnprotectiveCommands)
	}
}

func TestMergeNotOverwriteWithEmpty(t *testing.T) {
	a := Config{
		KeyFile:          "aid",
		DataFile:         "adata",
		FilteringCommand: "afil",
	}
	b := Config{
		KeyFile: "bid",
	}
	c := Config{
		DataFile: "cdata",
	}
	d := Config{
		FilteringCommand: "dfil",
	}
	z := Config{}<commit_msg>Fix misspel<commit_after>package main

import (
	"io/ioutil"
	"os"
	"path/filepath"
	"testing"
)

func TestMerge(t *testing.T) {
	a := Config{
		KeyFile:              "aid",
		DataFile:             "adata",
		FilteringCommand:     "afil",
		UnprotectiveCommands: []string{"new", "migrate"},
	}
	b := Config{
		KeyFile:              "bid",
		DataFile:             "bdata",
		FilteringCommand:     "bfil",
		UnprotectiveCommands: []string{"remove"},
	}
	x := a.Merge(b)
	if x.KeyFile != "bid" {
		t.Errorf("KeyFile should be 'bid', but got %s", x.KeyFile)
	}
	if x.DataFile != "bdata" {
		t.Errorf("DataFile should be 'bdata', but got %s", x.DataFile)
	}
	if x.FilteringCommand != "bfil" {
		t.Errorf("FilteringCommand should be 'bfil', but got %s", x.FilteringCommand)
	}
	if len(x.UnprotectiveCommands) == 1 && x.UnprotectiveCommands[0] != "remove" {
		t.Errorf("UnprotectiveCommands should be overridden, but got %s", x.UnprotectiveCommands)
	}
}

func TestMergeNotOverwriteWithEmpty(t *testing.T) {
	a := Config{
		KeyFile:          "aid",
		DataFile:         "adata",
		FilteringCommand: "afil",
	}
	b := Config{
		KeyFile: "bid",
	}
	c := Config{
		DataFile: "cdata",
	}
	d := Config{
		FilteringCommand: "dfil",
	}
	z := Config{}
{'fraction_non_alphanumeric': 0.16605913325232888, 'fraction_numerical': 0.0016200891049007696, 'mean_word_length': 3.1864406779661016, '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': '3774028', 'n_tokens_mistral': 991, 'n_tokens_neox': 941, 'n_words': 208}