<commit_before>package main

import (
	"os"
	"path"
	"testing"
)

func TestWorkDirPath(t *testing.T) {
	var (
		wd  string
		err error
		tmp = "temp"
	)

	if wd, err = workDirpath(); wd != "" || err == nil {
		t.Fatalf("%v, want: %s", wd, "<empty>")
	}
	os.Setenv("WORKSPACE", tmp)
	os.Mkdir(tmp, 0600)
	if wd, err = workDirpath(); err != nil {
		t.Fatalf("%v, want: %s", err, "")
	}
	if wd != tmp {
		t.Fatalf("%v, want: %s", wd, tmp)
	}

	c := &config{}
	c.TempDirpath = tmp
	c.cleanDirs()
}

func TestCurdir(t *testing.T) {
	if cwd := path.Base(curdir()); cwd != "godebbuild" {
		t.Fatalf("%v, want: godebbuild", cwd)
	}
}

func TestRunCommand(t *testing.T) {
	cmd := "foo"
	args := []string{}
	if err := runCommand(cmd, args...); err == nil {
		t.Fatal("want: <fail>")
	}
	cmd = "true"
	if err := runCommand(cmd, args...); err != nil {
		t.Fatal(err)
	}
}<commit_msg>Added unit test of Error().<commit_after>package main

import (
	"os"
	"path"
	"testing"
)

func TestWorkDirPath(t *testing.T) {
	var (
		wd  string
		err error
		tmp = "temp"
	)

	if wd, err = workDirpath(); wd != "" || err == nil {
		t.Fatalf("%v, want: %s", wd, "<empty>")
	}
	os.Setenv("WORKSPACE", tmp)
	os.Mkdir(tmp, 0600)
	if wd, err = workDirpath(); err != nil {
		t.Fatalf("%v, want: %s", err, "")
	}
	if wd != tmp {
		t.Fatalf("%v, want: %s", wd, tmp)
	}

	c := &config{}
	c.TempDirpath = tmp
	c.cleanDirs()
}

func TestCurdir(t *testing.T) {
	if cwd := path.Base(curdir()); cwd != "godebbuild" {
		t.Fatalf("%v, want: godebbuild", cwd)
	}
}

func TestRunCommand(t *testing.T) {
	cmd := "foo"
	args := []string{}
	if err := runCommand(cmd, args...); err == nil {
		t.Fatal("want: <fail>")
	}
	cmd = "true"
	if err := runCommand(cmd, args...); err != nil {
		t.Fatal(err)
	}
}

func TestError(t *testing.T) {
	if err := Error("test"); err == nil {
		t.Fatal("want: <fail>")
	}
}
{'fraction_non_alphanumeric': 0.2238966630785791, 'fraction_numerical': 0.004305705059203444, 'mean_word_length': 3.2735632183908048, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '710363', 'n_tokens_mistral': 848, 'n_tokens_neox': 827, 'n_words': 196}