func TestSearchMultiMatch(t *testing.T) {

	// mock a cheatsheet
	sheet := Sheet{
		Text: "The quick brown fox\n\njumped over\n\nthe lazy dog.",
	}

	// compile the search regex
	reg, err := regexp.Compile("(?i)the")
	if err != nil {
		t.Errorf("failed to compile regex: %v", err)
	}

	// search the sheet
	matches := sheet.Search(reg)

	// specify the expected results
	want := "The quick brown fox\n\nthe lazy dog."

	// assert that the correct matches were returned
	if !reflect.DeepEqual(matches, want) {
		t.Errorf(
			"failed to return expected matches: want:\n%s, got:\n%s",
			want,
			matches,
		)
	}
}
// TestSearchMultiMatch asserts that the expected output is returned
// when a multiple matches are returned
TestSearchMultiMatch asserts that the expected output is returned
when a multiple matches are returned
// TestSearchMultiMatch asserts that the expected output is returned // when a multiple matches are returned
func TestSearchMultiMatch(t *testing.T) {
	sheet := Sheet{
		Text: "The quick brown fox\n\njumped over\n\nthe lazy dog.",
	}
	reg, err := regexp.Compile("(?i)the")
	if err != nil {
		t.Errorf("failed to compile regex: %v", err)
	}
	matches := sheet.Search(reg)
	want := "The quick brown fox\n\nthe lazy dog."
	if !reflect.DeepEqual(matches, want) {
		t.Errorf(
			"failed to return expected matches: want:\n%s, got:\n%s",
			want,
			matches,
		)
	}
}
func TestSearchMultiMatch ( t * testing . T ) { sheet := Sheet { Text : " \n \n \n \n " , } reg , err := regexp . Compile ( " " ) if err != nil { t . Errorf ( " " , err ) } matches := sheet . Search ( reg ) want := " \n \n " if ! reflect . DeepEqual ( matches , want ) { t . Errorf ( " \n \n " , want , matches , ) } }
TestSearchMultiMatch asserts that the expected output is returned
when a multiple matches are returned
TestSearchMultiMatch asserts that the expected output is returned when a multiple matches are returned
// mock a cheatsheet // compile the search regex // search the sheet // specify the expected results // assert that the correct matches were returned