<commit_before>package geo

import (
	"encoding/json"
	"testing"
)

func TestGeometry(t *testing.T) {
	// Pass
	for _, testcase := range []struct {
		Input    geometry
		Expected Geometry
	}{
		{
			Input: geometry{
				Type:        LineType,
				Coordinates: json.RawMessage(`[[0,0],[1,1]]`),
			},
			Expected: &Line{
				{0, 0},
				{1, 1},
			},
		},
	} {
		g, err := testcase.Input.Geometry()
		if err != nil {
			t.Fatalf("failed to get geometry for %v: %s", testcase.Input, err)
		}
		if !testcase.Expected.Compare(g) {
			t.Fatalf("expected %v, got %v", testcase.Expected, g)
		}
	}
	// Fail
	for _, g := range []geometry{
		geometry{
			Type:        PointType,
			Coordinates: json.RawMessage(`{/}`),
		},
		geometry{
			Type:        LineType,
			Coordinates: json.RawMessage(`{/}`),
		},
		geometry{
			Type:        PolygonType,
			Coordinates: json.RawMessage(`{/}`),
		},
	} {
		if _, err := g.Geometry(); err == nil {
			t.Fatalf("expected error, got nil for %v", g)
		}
	}
}<commit_msg>simplify geometry test<commit_after>package geo

import (
	"encoding/json"
	"testing"
)

func TestGeometry(t *testing.T) {
	// Pass
	for _, testcase := range []struct {
		Input    geometry
		Expected Geometry
	}{
		{
			Input: geometry{
				Type:        LineType,
				Coordinates: json.RawMessage(`[[0,0],[1,1]]`),
			},
			Expected: &Line{
				{0, 0},
				{1, 1},
			},
		},
	} {
		g, err := testcase.Input.Geometry()
		if err != nil {
			t.Fatalf("failed to get geometry for %v: %s", testcase.Input, err)
		}
		if !testcase.Expected.Compare(g) {
			t.Fatalf("expected %v, got %v", testcase.Expected, g)
		}
	}
	// Fail
	for _, g := range []geometry{
		{
			Type:        PointType,
			Coordinates: json.RawMessage(`{/}`),
		},
		{
			Type:        LineType,
			Coordinates: json.RawMessage(`{/}`),
		},
		{
			Type:        PolygonType,
			Coordinates: json.RawMessage(`{/}`),
		},
	} {
		if _, err := g.Geometry(); err == nil {
			t.Fatalf("expected error, got nil for %v", g)
		}
	}
}
{'fraction_non_alphanumeric': 0.18337531486146097, 'fraction_numerical': 0.008060453400503778, 'mean_word_length': 2.5913200723327305, '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': '7413587', 'n_tokens_mistral': 868, 'n_tokens_neox': 759, 'n_words': 167}