<commit_before>package messages

import (
	"fmt"
	"os"
	"testing"
)

func TestVerifyHistorianMessage(t *testing.T) {
	s := "alexandria-historian-v001:pool.alexandria.io:0.000136008500:316306445.6533333:nr:0.00000500:0.00217:IN9OrF1Kpd5S0x36nXWI0lFjhnS1Z9I9k7cxWJrFUlsfcgwJytZ+GlKP1/tHCijAdGAX6LnOgOtcvI/vMQgVcwA="

	if os.Getenv("F_USER") == "" {
		t.Skip("skipping test; $F_TOKEN not set")
	}
	if os.Getenv("F_TOKEN") == "" {
		t.Skip("skipping test; $F_TOKEN not set")
	}

	// Don't need heavy testing of true address validity
	// The heavy lifting is done by the FlorinCoin daemon
	cases := []struct {
		in  string
		err error
	}{
		{s, nil},
		{s[:len(s)-1] + "a", ErrHistorianMessageBadSignature},
	}

	for _, c := range cases {
		got, err := VerifyHistorianMessage([]byte(c.in))
		if err != c.err {
			t.Errorf("VerifyHistorianMessage(%q) | err == %q, want %q", c.in, err, c.err)
		}
		// ToDo: check the decoded result
		fmt.Printf("%v\n", got)
		//if got != c.out {
		//	t.Errorf("CheckAddress(%q) == %q, want %q", c.in, got, c.out)
		//}
	}
}<commit_msg>Additional tests<commit_after>package messages

import (
	"fmt"
	"os"
	"strings"
	"testing"
)

func TestVerifyHistorianMessage(t *testing.T) {
	s := "alexandria-historian-v001:pool.alexandria.io:0.000136008500:316306445.6533333:nr:0.00000500:0.00217:IN9OrF1Kpd5S0x36nXWI0lFjhnS1Z9I9k7cxWJrFUlsfcgwJytZ+GlKP1/tHCijAdGAX6LnOgOtcvI/vMQgVcwA="

	if os.Getenv("F_USER") == "" {
		t.Skip("skipping test; $F_TOKEN not set")
	}
	if os.Getenv("F_TOKEN") == "" {
		t.Skip("skipping test; $F_TOKEN not set")
	}

	// Don't need heavy testing of true address validity
	// The heavy lifting is done by the FlorinCoin daemon
	cases := []struct {
		in  string
		err error
	}{
		{s, nil},
		{s[:len(s)-1] + "a", ErrHistorianMessageBadSignature},
		{s[:25], ErrHistorianMessageInvalid},
		{strings.Replace(s, "v001", "v002", 1), ErrHistorianMessageInvalid},
		{strings.Replace(s, "pool.", "notpool.", 1), ErrHistorianMessageInvalid},
	}

	for _, c := range cases {
		got, err := VerifyHistorianMessage([]byte(c.in))
		if err != c.err {
			t.Errorf("VerifyHistorianMessage(%q) | err == %q, want %q", c.in, err, c.err)
		}
		// ToDo: check the decoded result
		fmt.Printf("%v\n", got)
		//if got != c.out {
		//	t.Errorf("CheckAddress(%q) == %q, want %q", c.in, got, c.out)
		//}
	}
}
{'fraction_non_alphanumeric': 0.1757627847013322, 'fraction_numerical': 0.05672539750752041, 'mean_word_length': 4.127753303964758, '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': '328320', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1001, 'n_words': 190}