<commit_before>package toolbox

import (
	"context"
	"testing"
)

func TestJokeSources(t *testing.T) {
	text, err := getDadJoke(context.Background(), 10)
	if err != nil || text == "" {
		t.Fatal(err)
	}
	text, err = getChuckNorrisJoke(context.Background(), 10)
	if err != nil || text == "" {
		t.Fatal(err)
	}
}

func TestJoke(t *testing.T) {
	joke := Joke{}
	if !joke.IsConfigured() {
		t.Fatal("should be configured")
	}
	if err := joke.Initialise(); err != nil {
		t.Fatal(err)
	}
	if err := joke.SelfTest(); err != nil {
		t.Fatal(err)
	}

	if result := joke.Execute(context.Background(), Command{TimeoutSec: 10}); result.Error != nil || len(result.Output) < 30 {
		t.Fatal(result)
	} else {
		t.Log(result)
	}
}<commit_msg>toolbox: fix unlikely error in TestJoke<commit_after>package toolbox

import (
	"context"
	"testing"
)

func TestJokeSources(t *testing.T) {
	text, err := getDadJoke(context.Background(), 10)
	if err != nil || text == "" {
		t.Fatal(err)
	}
	text, err = getChuckNorrisJoke(context.Background(), 10)
	if err != nil || text == "" {
		t.Fatal(err)
	}
}

func TestJoke(t *testing.T) {
	joke := Joke{}
	if !joke.IsConfigured() {
		t.Fatal("should be configured")
	}
	if err := joke.Initialise(); err != nil {
		t.Fatal(err)
	}
	if err := joke.SelfTest(); err != nil {
		t.Fatal(err)
	}

	if result := joke.Execute(context.Background(), Command{TimeoutSec: 10}); result.Error != nil || len(result.Output) < 10 {
		t.Fatal(result)
	} else {
		t.Log(result)
	}
}
{'fraction_non_alphanumeric': 0.18556005398110662, 'fraction_numerical': 0.010796221322537112, 'mean_word_length': 3.7838709677419353, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5867529', 'n_tokens_mistral': 624, 'n_tokens_neox': 574, 'n_words': 125}