<commit_before>package libkb

import (
	"bytes"
	"strings"
	"testing"
)

var index *GpgKeyIndex

func TestParseMyKeyring(t *testing.T) {
	buf := bytes.NewBufferString(my_keyring)
	i, e, w := ParseGpgIndexStream(buf)
	if e != nil {
		t.Errorf("failure in parse: %s", e.Error())
	} else if !w.IsEmpty() {
		w.Warn()
		t.Errorf("Warnings in parsing")
	} else {
		index = i
	}
}

func TestFindMax(t *testing.T) {<commit_msg>fixed so these gpg index tests can run independently<commit_after>package libkb

import (
	"bytes"
	"strings"
	"testing"
)

func parse(t *testing.T) *GpgKeyIndex {
	buf := bytes.NewBufferString(my_keyring)
	i, e, w := ParseGpgIndexStream(buf)
	if e != nil {
		t.Fatalf("failure in parse: %s", e)
	}

	if !w.IsEmpty() {
		t.Errorf("Warnings in parsing:")
		w.Warn()
		return nil
	}
	return i
}

func TestParseMyKeyring(t *testing.T) {
	parse(t)
}

func TestFindMax(t *testing.T) {
	index := parse(t)
{'fraction_non_alphanumeric': 0.1514161220043573, 'fraction_numerical': 0.0, 'mean_word_length': 4.077348066298343, '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': '4980395', 'n_tokens_mistral': 381, 'n_tokens_neox': 373, 'n_words': 90}