<commit_before>package data

import (
	"log"
	"testing"

	"github.com/mdlayher/goat/goat/common"
)

// TestPeer verifies that Peer creation, methods, save, load, and delete work properly
func TestPeer(t *testing.T) {
	log.Println("TestPeer()")

	// Load config
	config, err := common.LoadConfig()
	if err != nil {
		t.Fatalf("Could not load configuration: %s", err.Error())
	}
	common.Static.Config = config

	// Generate mock peer
	peer := Peer{
		IP:   "127.0.0.1",
		Port: 8080,
	}

	// Marshal to binary representation
	out, err := peer.MarshalBinary()
	if err != nil {
		t.Fatalf("Failed to marshal peer to binary: %s", err.Error())
	}
<commit_msg>Remove unused import, clarify comments in peer_test<commit_after>package data

import (
	"log"
	"testing"
)

// TestPeer verifies that Peer binary marshal and unmarshal work properly
func TestPeer(t *testing.T) {
	log.Println("TestPeer()")

	// Generate mock peer
	peer := Peer{
		IP:   "127.0.0.1",
		Port: 8080,
	}

	// Marshal to binary representation
	out, err := peer.MarshalBinary()
	if err != nil {
		t.Fatalf("Failed to marshal peer to binary: %s", err.Error())
	}

{'fraction_non_alphanumeric': 0.14209591474245115, 'fraction_numerical': 0.017761989342806393, 'mean_word_length': 3.65702479338843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1839706', 'n_tokens_mistral': 419, 'n_tokens_neox': 392, 'n_words': 117}