<commit_before>package resolve

import (
	"os"
	"testing"
)

func TestResolve(t *testing.T) {
	pwd, err := os.Getwd()

	if err != nil {
		t.Fatal(err)
	}

	testcases := map[string]string{
		"./test/hello.js": "test/hello.js",
		"./test/hello": "test/hello.js",
		"./test/other-file.js": "test/other-file.js",
		"./test/other-file": "test/other-file.js",
		"./test/just-dir/hello-1": "test/just-dir/hello-1.js",
		"./test/just-dir/hello-2": "test/just-dir/hello-2.js",
		"./test/just-dir/index": "test/just-dir/index.js",

		// FIXME
		"./test/just-dir": "test/just-dir/index.js",

		"./test/module-with-main": "test/module-with-main/main.js",
		"./test/module-with-main/package.json": "test/module-with-main/package.json",
		"./test/module-without-main": "test/module-without-main/index.js",
	}

	for required, resolved := range testcases {
		dependency, err := Resolve(required, pwd)
		if err != nil {
			t.Error("Should not have thrown an error: ", err)
		}
		expected := pwd + string(os.PathSeparator) + resolved

		if dependency == nil || dependency.Pathname != expected {
			t.Error("Expected ", expected, " got ", dependency)
		}
	}

}<commit_msg>chore: Remove FIXME from README<commit_after>package resolve

import (
	"os"
	"testing"
)

func TestResolve(t *testing.T) {
	pwd, err := os.Getwd()
	if err != nil {
		t.Fatal(err)
	}

	testcases := map[string]string{
		"./test/hello.js": "test/hello.js",
		"./test/hello": "test/hello.js",
		"./test/other-file.js": "test/other-file.js",
		"./test/other-file": "test/other-file.js",
		"./test/just-dir/hello-1": "test/just-dir/hello-1.js",
		"./test/just-dir/hello-2": "test/just-dir/hello-2.js",
		"./test/just-dir/index": "test/just-dir/index.js",
		"./test/just-dir": "test/just-dir/index.js",
		"./test/module-with-main": "test/module-with-main/main.js",
		"./test/module-with-main/package.json": "test/module-with-main/package.json",
		"./test/module-without-main": "test/module-without-main/index.js",
	}

	for required, resolved := range testcases {
		dependency, err := Resolve(required, pwd)
		if err != nil {
			t.Error("Should not have thrown an error: ", err)
		}
		expected := pwd + string(os.PathSeparator) + resolved

		if dependency == nil || dependency.Pathname != expected {
			t.Error("Expected ", expected, " got ", dependency)
		}
	}

}
{'fraction_non_alphanumeric': 0.21341991341991343, 'fraction_numerical': 0.003463203463203463, 'mean_word_length': 3.3277153558052435, 'pattern_counts': {'":': 22, '<': 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': '570098', 'n_tokens_mistral': 944, 'n_tokens_neox': 890, 'n_words': 147}