<commit_before>package main

import (
	"testing"
)

const (
	dsMake = 0
	dsFind = 1
	dsJoin = 2
)

type disjoinSetAct struct {
	Op int
	X  int
	Y  int
}

type disjoinSetTest struct {
	Act []disjoinSetAct
}

var disjoinSetTests = []disjoinSetTest{
	{
		[]disjoinSetAct{
			{Op: dsMake, X: 0},
			{Op: dsMake, X: 1},
			{Op: dsMake, X: 2},
			{Op: dsMake, X: 3},
			{Op: dsFind, X: 0, Y: 0},
			{Op: dsFind, X: 1, Y: 1},

			{Op: dsJoin, X: 0, Y: 1},
			{Op: dsFind, X: 0, Y: 0},
			{Op: dsFind, X: 1, Y: 0},

			{Op: dsJoin, X: 0, Y: 2},
			{Op: dsFind, X: 0, Y: 0},
			{Op: dsFind, X: 2, Y: 0},

			{Op: dsJoin, X: 3, Y: 2},
			{Op: dsFind, X: 0, Y: 0},
			{Op: dsFind, X: 2, Y: 0},
		},
	},
}

func TestDisjoinSet(t *testing.T) {
	for testInd, test := range disjoinSetTests {
		s := NewDisjoinSet()
		for actInd, act := range test.Act {
			switch act.Op {
			case dsMake:
				x := s.Make()
				if x != act.X {
					t.Errorf("Test #%d, act #%d, Op: dsMake, unexpected result. Want %d, got %d",
						testInd, actInd, x, act.X)
				}
			case dsFind:
				y := s.Find(act.X)
				if y != act.Y {
					t.Errorf("Test #%d, act #%d, Op: dsFind(%d), unexpected result. Want %d, got %d",
						testInd, actInd, act.X, act.Y, y)
				}
			case dsJoin:
				s.Join(act.X, act.Y)
			default:
				t.Fatalf("Test #%d, act #%d, unknown Op: %d", testInd, actInd, act.Op)
			}
		}
	}
}
<commit_msg>Add few more test cases for disjoin path<commit_after>package main

import (
	"testing"
)

const (
	dsMake = 0
	dsFind = 1
	dsJoin = 2
)

type disjoinSetAct struct {
	Op int
	X  int
	Y  int
}

type disjoinSetTest struct {
	Act []disjoinSetAct
}

var disjoinSetTests = []disjoinSetTest{
	{
		[]disjoinSetAct{
			{Op: dsMake, X: 0},
			{Op: dsMake, X: 1},
			{Op: dsMake, X: 2},
			{Op: dsMake, X: 3},
			{Op: dsMake, X: 4},
			{Op: dsFind, X: 0, Y: 0},
			{Op: dsFind, X: 1, Y: 1},

			{Op: dsJoin, X: 0, Y: 1},
			{Op: dsFind, X: 0, Y: 0},
			{Op: dsFind, X: 1, Y: 0},

			{Op: dsJoin, X: 0, Y: 2},
			{Op: dsFind, X: 0, Y: 0},
			{Op: dsFind, X: 2, Y: 0},

			{Op: dsJoin, X: 3, Y: 4},
			{Op: dsFind, X: 3, Y: 3},
			{Op: dsFind, X: 4, Y: 3},

			{Op: dsJoin, X: 3, Y: 0},
			{Op: dsFind, X: 0, Y: 3},
			{Op: dsFind, X: 3, Y: 3},
		},
	},
}

func TestDisjoinSet(t *testing.T) {
	for testInd, test := range disjoinSetTests {
		s := NewDisjoinSet()
		for actInd, act := range test.Act {
			switch act.Op {
			case dsMake:
				x := s.Make()
				if x != act.X {
					t.Errorf("Test #%d, act #%d, Op: dsMake, unexpected result. Want %d, got %d",
						testInd, actInd, x, act.X)
				}
			case dsFind:
				y := s.Find(act.X)
				if y != act.Y {
					t.Errorf("Test #%d, act #%d, Op: dsFind(%d), unexpected result. Want %d, got %d",
						testInd, actInd, act.X, act.Y, y)
				}
			case dsJoin:
				s.Join(act.X, act.Y)
			default:
				t.Fatalf("Test #%d, act #%d, unknown Op: %d", testInd, actInd, act.Op)
			}
		}
	}
}

{'fraction_non_alphanumeric': 0.19267955801104972, 'fraction_numerical': 0.02244475138121547, 'mean_word_length': 2.4777911164465785, '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': '2191647', 'n_tokens_mistral': 1579, 'n_tokens_neox': 1322, 'n_words': 409}