<commit_before>package queue

import (
	"fmt"
	"testing"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/stretchr/testify/assert"
)

func init() {
}

func TestAdaptorConstruction(t *testing.T) {
	config := aws.NewConfig().WithRegion("somewhere")
	testsqs := NewSQSAdaptor(config, "testqueue")
	assert.Equal(t, testsqs.QueueURL, "testqueue")
}

func TestJSON(t *testing.T) {
	result := AggData{
		299,
		234,
		256,
		int64(9999),
		2136,
		make(map[string]int),
		int64(12345),
		float32(6789),
		float32(6789),
		int64(4567),
		int64(4567),
		"eu-west",
		"sorry",
	}
	str, jsonerr := jsonFromResult(result)
	if jsonerr != nil {
		fmt.Println(jsonerr)
		return
	}
	assert.Equal(t, str, "{\"total-reqs\":299,\"total-timed-out\":234,\"ave-time-to-first\":9999,\"tot-bytes-read\":2136,\"statuses\":{},\"ave-time-for-req\":12345,\"ave-req-per-sec\":6789,\"slowest\":4567,\"fastest\":4567,\"region\":\"eu-west\"}")
}<commit_msg>unit(e) test, fix on output matching<commit_after>package queue

import (
	"fmt"
	"testing"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/stretchr/testify/assert"
)

func init() {
}

func TestAdaptorConstruction(t *testing.T) {
	config := aws.NewConfig().WithRegion("somewhere")
	testsqs := NewSQSAdaptor(config, "testqueue")
	assert.Equal(t, testsqs.QueueURL, "testqueue")
}

func TestJSON(t *testing.T) {
	result := AggData{
		299,
		234,
		256,
		int64(9999),
		2136,
		make(map[string]int),
		int64(12345),
		float32(6789),
		float32(6789),
		int64(4567),
		int64(4567),
		"eu-west",
		"sorry",
	}
	str, jsonerr := jsonFromResult(result)
	if jsonerr != nil {
		fmt.Println(jsonerr)
		return
	}
	assert.Equal(t, str, "{\"total-reqs\":299,\"total-timed-out\":234,\"total-conn-error\":256,\"ave-time-to-first\":9999,\"tot-bytes-read\":2136,\"statuses\":{},\"ave-time-for-req\":12345,\"ave-req-per-sec\":6789,\"ave-kbytes-per-sec\":6789,\"slowest\":4567,\"fastest\":4567,\"region\":\"eu-west\",\"fatal-error\":\"sorry\"}")
}
{'fraction_non_alphanumeric': 0.22433264887063656, 'fraction_numerical': 0.08675564681724846, 'mean_word_length': 4.474719101123595, 'pattern_counts': {'":': 23, '<': 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': '6781149', 'n_tokens_mistral': 956, 'n_tokens_neox': 812, 'n_words': 103}