<commit_before>package wellington

import "testing"

func TestPath_recurse(t *testing.T) {

	paths := pathsToFiles([]string{"test/includes"}, true)
	if len(paths) != 1 {
		t.Fatal("wrong number of returned paths")
	}

	// This is going to be a really annoying test, should setup a special
	// directory to test this.
	paths = pathsToFiles([]string{"test"}, true)
	if e := 18; len(paths) != e {
		t.Errorf("got: %d wanted: %d", len(paths), e)
	}
}

func TestPath_files(t *testing.T) {

	paths := pathsToFiles([]string{"test/includes"}, false)
	if len(paths) != 1 {
		t.Fatal("wrong number of returned paths")
	}

	// This is going to be a really annoying test, should setup a special
	// directory to test this.
	paths = pathsToFiles([]string{"test"}, false)
	if e := 2; len(paths) != e {
		t.Errorf("got: %d wanted: %d", len(paths), e)
	}
}

func TestRelative(t *testing.T) {
	paths := []string{"../test/sass", "test/sass", "/tmp"}
	var r string
	r = relative(paths, "test/sass/file.scss")
	if e := `.`; r != e {
		t.Errorf("got: %s wanted: %s", r, e)
	}

	r = relative(paths, "test/sass/subdir/file.scss")
	if e := `subdir`; r != e {
		t.Errorf("got: %s wanted: %s", r, e)
	}

	r = relative(paths, "../test/sass/subdir/file.scss")
	if e := `subdir`; r != e {
		t.Errorf("got: %s wanted: %s", r, e)
	}

	r = relative(paths, "/tmp/sass/file.scss")
	if e := `sass`; r != e {
		t.Errorf("got: %s wanted: %s", r, e)
	}

}

func TestRelative_specificity(t *testing.T) {
	paths := []string{"/tmp", "/tmp/testdir", "/boom"}
	r := relative(paths, "/tmp/testdir/file.scss")
	if e := "testdir"; r != e {<commit_msg>relative parsing is incorrect when paths are out of order<commit_after>package wellington

import (
	"fmt"
	"testing"
)

func TestPath_recurse(t *testing.T) {

	paths := pathsToFiles([]string{"test/includes"}, true)
	if len(paths) != 1 {
		t.Fatal("wrong number of returned paths")
	}

	// This is going to be a really annoying test, should setup a special
	// directory to test this.
	paths = pathsToFiles([]string{"test"}, true)
	if e := 18; len(paths) != e {
		t.Errorf("got: %d wanted: %d", len(paths), e)
	}
}

func TestPath_files(t *testing.T) {

	paths := pathsToFiles([]string{"test/includes"}, false)
	if len(paths) != 1 {
		t.Fatal("wrong number of returned paths")
	}

	// This is going to be a really annoying test, should setup a special
	// directory to test this.
	paths = pathsToFiles([]string{"test"}, false)
	if e := 2; len(paths) != e {
		t.Errorf("got: %d wanted: %d", len(paths), e)
	}
}

func TestPath_underscore(t *testing.T) {

	paths := []string{"a/a.scss"}
	fmt.Println(relative(paths, paths[0]))

	paths = []string{"a/a.scss", "a/subdir/subdir.scss"}
	fmt.Println(relative(paths, paths[1]))

	paths = []string{"a/subdir/subdir.scss", "a/a.scss"}
	fmt.Println(relative(paths, paths[1]))

}

func TestRelative(t *testing.T) {
	paths := []string{"../test/sass", "test/sass", "/tmp"}
	var r string
	r = relative(paths, "test/sass/file.scss")
	if e := `.`; r != e {
		t.Errorf("got: %s wanted: %s", r, e)
	}

	r = relative(paths, "test/sass/subdir/file.scss")
	if e := `subdir`; r != e {
		t.Errorf("got: %s wanted: %s", r, e)
	}

	r = relative(paths, "../test/sass/subdir/file.scss")
	if e := `subdir`; r != e {
		t.Errorf("got: %s wanted: %s", r, e)
	}

	r = relative(paths, "/tmp/sass/file.scss")
	if e := `sass`; r != e {
		t.Errorf("got: %s wanted: %s", r, e)
	}

}

func TestRelative_specificity(t *testing.T) {
	paths := []string{"/tmp", "/tmp/testdir", "/boom"}
	r := relative(paths, "/tmp/testdir/file.scss")
	if e := "testdir"; r != e {
{'fraction_non_alphanumeric': 0.20542961097117268, 'fraction_numerical': 0.003638399104394067, 'mean_word_length': 3.7026315789473685, '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': '3547279', 'n_tokens_mistral': 1453, 'n_tokens_neox': 1399, 'n_words': 375}