content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 01:25:52 GMT 2024
   */
  
  package ghm.follow.search;
  
  import org.junit.jupiter.api.Test;
  import static org.junit.jupiter.api.Assertions.*;
  import org.junit.jupiter.api.Timeout;
  import java.util.concurrent.TimeUnit;
  import ghm.follow.search.LineResult;
  import ghm.follow.search.SearchableTextPane;
  import java.awt.Font;
  import java.io.StringReader;
  import java.text.AttributedCharacterIterator;
  import java.util.List;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class SearchableTextPane_ESTest extends SearchableTextPane_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSearchTaking2ArgumentsReturningZero() throws Throwable  {
        // Given a SearchableTextPane with a specific font and size
        SearchableTextPane searchableTextPane = new SearchableTextPane((Font) null, 2721);
        
        // When searching for an empty string
        int search = searchableTextPane.search("", (-1));
        
        // Then the method should return 0
        assertEquals(0, search);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSearchTaking2ArgumentsReturningPositive() throws Throwable  {
        // Test that the search method returns the correct index when searching for an empty string at position 1.
        SearchableTextPane searchableTextPane = new SearchableTextPane((Font) null, 2363);
        StringReader arg0 = new StringReader("^ckF*#T]P0i%b+");
        AttributedCharacterIterator.Attribute arg1 = AttributedCharacterIterator.Attribute.READING;
        searchableTextPane.read(arg0, arg1);
        int expectedSearchResult = 1;
        int actualSearchResult = searchableTextPane.search("", 1);
        assertEquals(expectedSearchResult, actualSearchResult);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSearchTakingStringReturningPositive() throws Throwable  {
        // No Comments were added
        SearchableTextPane searchableTextPane = new SearchableTextPane((Font) null, (-2180));
        StringReader arg0 = new StringReader("JXi~H=w1q=:xz^\"A!");
        searchableTextPane.read(arg0, (Object) null);
        int search = searchableTextPane.search("=");
        assertEquals(5, search);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveHighlights() throws Throwable  {
        // Test that removing highlights from a SearchableTextPane sets the ignore repaint flag to false
        SearchableTextPane searchableTextPane = new SearchableTextPane((Font) null, 0);
        searchableTextPane.removeHighlights();
        assertFalse(searchableTextPane.getIgnoreRepaint());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSearchTaking2ArgumentsReturningNegative() throws Throwable  {
        // No Comments were added
        SearchableTextPane searchableTextPane = new SearchableTextPane((Font) null, (-2180));
        int search = searchableTextPane.search("JXi~H=w1q=:xz^\"A!", 0);
        assertEquals((-1), search);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHighlightReturningListWhereIsEmptyIsTrue() throws Throwable  {
        SearchableTextPane searchableTextPane = new SearchableTextPane((Font) null, 0);
        List<LineResult> highlights = searchableTextPane.highlight("The quick brown fox jumps over the lazy dog.", 0);
        assertTrue(highlights.isEmpty());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSearchTakingStringReturningNegative() throws Throwable  {
        // Given a SearchableTextPane with a null font and a negative font size
        SearchableTextPane searchableTextPane = new SearchableTextPane((Font) null, (-1060));
        
        // When we call the search method with a null string as the search term
        int search = searchableTextPane.search((String) null);
        
        // Then the method should return -1 as there is no text to search for
        assertEquals((-1), search);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHighlightWithEmptyString() throws Throwable  {
        // Given: A SearchableTextPane instance with a null font and zero lines
        SearchableTextPane searchableTextPane = new SearchableTextPane((Font) null, 0);
        
        // When: The highlight method is called with an empty string and zero lines
        List<LineResult> highlight = searchableTextPane.highlight("", 0);
        
        // Then: The returned list of LineResults should be empty
        assertTrue(highlight.isEmpty());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetScrollableTracksViewportWidth() throws Throwable  {
        // Given: A SearchableTextPane instance with a null font and a negative size
        SearchableTextPane searchableTextPane = new SearchableTextPane((Font) null, (-2180));
        
        // When: The getScrollableTracksViewportWidth method is called on the instance
        boolean scrollableTracksViewportWidth = searchableTextPane.getScrollableTracksViewportWidth();
        
        // Then: The method should return true
        assertTrue(scrollableTracksViewportWidth);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHighlightReturningListWhereIsEmptyIsFalse() throws Throwable  {
        SearchableTextPane searchableTextPane = new SearchableTextPane((Font) null, (-2180));
        // Initialize the SearchableTextPane with a specific font and initial text
        
        StringReader arg0 = new StringReader("JXi~H=w1q=:xz^\"A!");
        // Create a string reader with the test text
        
        searchableTextPane.read(arg0, (Object) null);
        // Read the test text into the SearchableTextPane
        
        List<LineResult> highlight = searchableTextPane.highlight("=", (-147));
        // Highlight all occurrences of "=" in the SearchableTextPane
        
        assertEquals(1, highlight.size());
        // Assert that there is one occurrence of "=" in the SearchableTextPane);
    }
  }
  