func TestSearchNoMatch(t *testing.T) {

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

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

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

	// assert that no matches were found
	if matches != "" {
		t.Errorf("failure: expected no matches: got: %s", matches)
	}
}
// TestSearchNoMatch ensures that the expected output is returned when no
// matches are found
TestSearchNoMatch ensures that the expected output is returned when no
matches are found
// TestSearchNoMatch ensures that the expected output is returned when no // matches are found
func TestSearchNoMatch(t *testing.T) {
	sheet := Sheet{
		Text: "The quick brown fox\njumped over\nthe lazy dog.",
	}
	reg, err := regexp.Compile("(?i)foo")
	if err != nil {
		t.Errorf("failed to compile regex: %v", err)
	}
	matches := sheet.Search(reg)
	if matches != "" {
		t.Errorf("failure: expected no matches: got: %s", matches)
	}
}
func TestSearchNoMatch ( t * testing . T ) { sheet := Sheet { Text : " \n \n " , } reg , err := regexp . Compile ( " " ) if err != nil { t . Errorf ( " " , err ) } matches := sheet . Search ( reg ) if matches != " " { t . Errorf ( " " , matches ) } }
TestSearchNoMatch ensures that the expected output is returned when no
matches are found
TestSearchNoMatch ensures that the expected output is returned when no matches are found
// mock a cheatsheet // compile the search regex // search the sheet // assert that no matches were found