<commit_before>package reporting

import (
	"github.com/smartystreets/goconvey/gotest"
	"runtime"
	"strings"
)

type AssertionResult struct {
	File       string
	Line       int
	Failure    string
	Error      interface{}
	StackTrace string
	Skipped    bool
}

func NewFailureReport(failure string) *AssertionResult {
	file, line := caller()
	stack := stackTrace()
	report := AssertionResult{file, line, failure, nil, stack, false}
	return &report
}
func NewErrorReport(err interface{}) *AssertionResult {
	file, line := caller()
	stack := fullStackTrace()
	report := AssertionResult{file, line, "", err, stack, false}
	return &report
}
func NewSuccessReport() *AssertionResult {
	file, line := caller()
	stack := stackTrace()
	report := AssertionResult{file, line, "", nil, stack, false}
	return &report
}
func NewSkipReport() *AssertionResult {
	file, line := caller()
	stack := stackTrace()
	report := AssertionResult{file, line, "", nil, stack, true}
	return &report<commit_msg>Refactored report creation methods to allow for more flexible addition/deletion of AssertionResult fields.<commit_after>package reporting

import (
	"github.com/smartystreets/goconvey/gotest"
	"runtime"
	"strings"
)

type AssertionResult struct {
	File string
	Line int
	// Expected   string // TODO: unmarshall
	// Actual     string // TODO: unmarshall
	Failure    string
	Error      interface{}
	StackTrace string
	Skipped    bool
}

func NewFailureReport(failure string) *AssertionResult {
	report := &AssertionResult{}
	report.File, report.Line = caller()
	report.StackTrace = stackTrace()
	report.Failure = failure
	// TODO: unmarshall string if possible, assign to Expected, Actual, and Failure
	return report
}
func NewErrorReport(err interface{}) *AssertionResult {
	report := &AssertionResult{}
	report.File, report.Line = caller()
	report.StackTrace = fullStackTrace()
	report.Error = err
	return report
}
func NewSuccessReport() *AssertionResult {
	report := &AssertionResult{}
	report.File, report.Line = caller()
	report.StackTrace = fullStackTrace()
	return report
}
func NewSkipReport() *AssertionResult {
	report := &AssertionResult{}
	report.File, report.Line = caller()
	report.StackTrace = fullStackTrace()
	report.Skipped = true
	return report
{'fraction_non_alphanumeric': 0.10967454302273741, 'fraction_numerical': 0.0, 'mean_word_length': 4.768637532133676, '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': '6412430', 'n_tokens_mistral': 669, 'n_tokens_neox': 666, 'n_words': 195}