<commit_before>package main

import (
	"reflect"
	"testing"
)

func TestFindMatching(t *testing.T) {
	corpus := []string{
		"web/site/file.html",
		"web/site/file2.html",
		"web/site/x/x.html",
		"web/site/thing.png",
		"web/site/robots.txt",
	}

	tests := []struct {
		params []string
		exp    []string
	}{
		/* These two are currently broken.
			{nil,
				[]string{
					"web/site",
					"web/site/file.html",
					"web/site/file2.html",
					"web/site/x",
					"web/site/x/x.html",
					"web/site/thing.png",
					"web/site/robots.txt",
				},
			},
		{[]string{"-name", "*"}, corpus},
		{
			[]string{"-name", "*.png"},
			[]string{"web/site/thing.png"},
		},
		*/
		{
			[]string{"-name", "thing.png"},
			[]string{"web/site/thing.png"},
		},
		{
			[]string{"-name", "*.html"},
			[]string{
				"web/site/file.html",
				"web/site/file2.html",
				"web/site/x/x.html",
			},
		},
		/* soooon
		{
			[]string{"-name", "web"},
			[]string{"web"},
		},<commit_msg>Ah, * and "" give you slightly different answers<commit_after>package main

import (
	"reflect"
	"testing"
)

func TestFindMatching(t *testing.T) {
	corpus := []string{
		"web/site/file.html",
		"web/site/file2.html",
		"web/site/x/x.html",
		"web/site/thing.png",
		"web/site/robots.txt",
	}

	tests := []struct {
		params []string
		exp    []string
	}{
		{nil, corpus},
		{[]string{"-name", "*"},
			[]string{
				"web/site",
				"web/site/file.html",
				"web/site/file2.html",
				"web/site/x",
				"web/site/x/x.html",
				"web/site/thing.png",
				"web/site/robots.txt",
			},
		},
		{
			[]string{"-name", "*.png"},
			[]string{"web/site/thing.png"},
		},
		{
			[]string{"-name", "thing.png"},
			[]string{"web/site/thing.png"},
		},
		{
			[]string{"-name", "*.html"},
			[]string{
				"web/site/file.html",
				"web/site/file2.html",
				"web/site/x/x.html",
			},
		},
		/* soooon
		{
			[]string{"-name", "web"},
			[]string{"web"},
		},
{'fraction_non_alphanumeric': 0.25521920668058456, 'fraction_numerical': 0.003131524008350731, 'mean_word_length': 2.563197026022305, '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': '98762', 'n_tokens_mistral': 963, 'n_tokens_neox': 803, 'n_words': 107}