<commit_before>package bencode

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

var unmarshalTestData = []byte("d4:infod6:lengthi170917888e12:piece lengthi262144e4:name30:debian-8.8.0-arm64-netinst.isoe8:announce38:udp://tracker.publicbt.com:80/announce13:announce-listll38:udp://tracker.publicbt.com:80/announceel44:udp://tracker.openbittorrent.com:80/announceee7:comment33:Debian CD from cdimage.debian.orge")

func TestUnmarshal(t *testing.T) {
	assert := assert.New(t)
<commit_msg>update unmarshal tests<commit_after>package bencode

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

var (
	unmarshalTestData      = []byte("d4:infod6:lengthi170917888e12:piece lengthi262144e4:name30:debian-8.8.0-arm64-netinst.isoe8:announce38:udp://tracker.publicbt.com:80/announce13:announce-listll38:udp://tracker.publicbt.com:80/announceel44:udp://tracker.openbittorrent.com:80/announceee7:comment33:Debian CD from cdimage.debian.orge")
	unmarshalWrongTestData = []byte("d4:infod6:lengthi170917888e12:piece lengthi262144e4:name30:debian-8.8.0-arm64-netinst.isoe8:announce38:udp://tracker.publicbt.com:80/announce13:announce-listll38:udp://tracker.publicbt.com:80/announceel44:udp://tracker.openbittorrent.com:80/announceee7:comment35:Debian CD from cdimage.debian.orge")
)

func TestUnmarshal(t *testing.T) {
	assert := assert.New(t)

	_, err := Unmarshal(unmarshalTestData)
	if !assert.NoError(err) {
		return
	}

	_, err = Unmarshal(unmarshalWrongTestData)
	if !assert.Error(err) || !assert.Equal("bencode: not a valid bencoded string", err.Error()) {
		return
	}

{'fraction_non_alphanumeric': 0.14466203411244472, 'fraction_numerical': 0.08528111181301326, 'mean_word_length': 6.802955665024631, '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': '6676738', 'n_tokens_mistral': 712, 'n_tokens_neox': 631, 'n_words': 59}