<commit_before>package main

import "testing"

func ensureDimensions(t *testing.T, ic *ImageConfiguration, w int, h int) {
	if ic.width != w {
		t.Errorf("expected %v to be %v", ic.width, w)

	}
	if ic.height != h {
		t.Errorf("expected %v to be %v", ic.width, h)
	}
}

func TestRectangle(t *testing.T) {
	ic, _ := NameToConfiguration("300x400.jpg")
	ensureDimensions(t, ic, 300, 400)
}

func TestSquare(t *testing.T) {
	ic, _ := NameToConfiguration("x300.jpg")
	ensureDimensions(t, ic, 300, 300)
}

func TestWidth(t *testing.T) {
	ic, _ := NameToConfiguration("w300.jpg")
	ensureDimensions(t, ic, 300, 0)
}

func TestFullSize(t *testing.T) {
	ic, _ := NameToConfiguration("full_size.jpg")
	ensureDimensions(t, ic, 0, 0)
}

func TestUnsupported(t *testing.T) {
	_, err := NameToConfiguration("random.jpg")
	if err == nil {
		t.Errorf("expected to receive an error")
	}
}<commit_msg>NameToConfiguration tests format extraction<commit_after>package main

import "testing"

func ensureDimensions(t *testing.T, ic *ImageConfiguration, w int, h int, f string) {
	if ic.width != w {
		t.Errorf("expected %v to be %v", ic.width, w)

	}
	if ic.height != h {
		t.Errorf("expected %v to be %v", ic.width, h)
	}
	if ic.format != f {
		t.Errorf("expected %v to be %v", ic.format, f)
	}
}

func TestRectangle(t *testing.T) {
	ic, _ := NameToConfiguration("300x400.jpg")
	ensureDimensions(t, ic, 300, 400, "jpg")
}

func TestSquare(t *testing.T) {
	ic, _ := NameToConfiguration("x300.jpg")
	ensureDimensions(t, ic, 300, 300, "jpg")
}

func TestWidth(t *testing.T) {
	ic, _ := NameToConfiguration("w300.jpg")
	ensureDimensions(t, ic, 300, 0, "jpg")
}

func TestFullSize(t *testing.T) {
	ic, _ := NameToConfiguration("full_size.jpg")
	ensureDimensions(t, ic, 0, 0, "jpg")
}

func TestUnsupported(t *testing.T) {
	_, err := NameToConfiguration("random.jpg")
	if err == nil {
		t.Errorf("expected to receive an error")
	}
}
{'fraction_non_alphanumeric': 0.16587926509186351, 'fraction_numerical': 0.031496062992125984, 'mean_word_length': 4.477011494252873, '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': '5353180', 'n_tokens_mistral': 793, 'n_tokens_neox': 731, 'n_words': 183}