<commit_before>package gass

import (
	"testing"
)

func testFile(t *testing.T, file string) {
	if _, err := CompileFile(file, true); err != nil {
		t.Error(err)
	}
}

func TestParser(t *testing.T) {
	testFile("test/parser.gass", "test/parser.css")
	testFile("test/variables.gass", "test/variables.css")
	testFile("test/functions.gass", "test/functions.css")
}

/*
func processExpect(path string, info os.FileInfo, err error) error {
	if filepath.Ext(path) == ".gass" && !strings.HasPrefix(path, "_") {
		in, err := ioutil.ReadFile(path)
		if err != nil {
			return err
		}
		out := CompileString(string(in))
		exp, err := ioutil.ReadFile(path[:len(path)-5] + ".expect")
		if err != nil {
			return err
		}
		ioutil.WriteFile(path[:len(path)-5]+".log", []byte(out), 0)
		if out != string(exp) {
			return errors.New("mismatch:" + path)
		}
	}
	return nil
}

func TestExpect(t *testing.T) {
	if err := filepath.Walk("test/expect", processExpect); err != nil {
		t.Error(err)
	}
}<commit_msg>fix gass_test error<commit_after>package gass

import (
	"testing"
)

func testFile(t *testing.T, file string) {
	if _, err := CompileFile(file, true); err != nil {
		t.Error(err)
	}
}

func TestParser(t *testing.T) {
	testFile(t, "test/parser.gass")
	testFile(t, "test/variables.gass")
	testFile(t, "test/functions.gass")
}

/*
func processExpect(path string, info os.FileInfo, err error) error {
	if filepath.Ext(path) == ".gass" && !strings.HasPrefix(path, "_") {
		in, err := ioutil.ReadFile(path)
		if err != nil {
			return err
		}
		out := CompileString(string(in))
		exp, err := ioutil.ReadFile(path[:len(path)-5] + ".expect")
		if err != nil {
			return err
		}
		ioutil.WriteFile(path[:len(path)-5]+".log", []byte(out), 0)
		if out != string(exp) {
			return errors.New("mismatch:" + path)
		}
	}
	return nil
}

func TestExpect(t *testing.T) {
	if err := filepath.Walk("test/expect", processExpect); err != nil {
		t.Error(err)
	}
}
{'fraction_non_alphanumeric': 0.18633540372670807, 'fraction_numerical': 0.003105590062111801, 'mean_word_length': 3.969151670951157, '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': '2674832', 'n_tokens_mistral': 792, 'n_tokens_neox': 752, 'n_words': 156}