content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 07:42:30 GMT 2024
   */
  
  package umd.cs.shop;
  
  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 static org.evosuite.runtime.EvoAssertions.*;
  import java.io.StreamTokenizer;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  import umd.cs.shop.JSPredicateForm;
  import umd.cs.shop.JSSubstitution;
  import umd.cs.shop.JSTerm;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class JSPredicateForm_ESTest extends JSPredicateForm_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatches() throws Throwable  {
        // rollbacked to evosuite
        JSTerm jSTerm = new JSTerm();
        jSTerm.add((Object) "(");
        JSTerm arg0 = new JSTerm();
        JSSubstitution matches = jSTerm.matches((JSPredicateForm) arg0);
        assertTrue(matches.fail());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesJSPredicateFormTakingNoArgumentsAndCallsPrint() throws Throwable  {
        // Given a JSPredicateForm object
        JSPredicateForm form = new JSPredicateForm();
        
        // When the print method is called on it
        form.print();
        
        // Then the output should be an empty string
        assertEquals("[]", form.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToStr() throws Throwable  {
        // Given a JSPredicateForm with a valid predicate
        JSPredicateForm jSPredicateForm = new JSPredicateForm("(PJ)q^ -;{~zk` O");
        
        // When the toStr method is called
        StringBuffer str = jSPredicateForm.toStr();
        
        // Then the string representation of the predicate should have 4 characters
        assertEquals(4, str.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateJSPredicateFormTakingStringThrowsError0() throws Throwable  {
        // Given
        JSPredicateForm jSPredicateForm = null;
        
        try {
        // When
        jSPredicateForm = new JSPredicateForm("(r iJX|LEM;z(nK:ZO");
        
        // Then
        fail("Expecting exception: Error");
        
        } catch(Error e) {
        // no message in exception (getMessage() returned null)
        verifyException("umd.cs.shop.JSPredicateForm", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateJSPredicateFormTakingStringThrowsError1() throws Throwable  {
        JSPredicateForm jSPredicateForm = null;
        try {
        jSPredicateForm = new JSPredicateForm("(");
        fail("Expecting exception: Error");
        
        } catch(Error e) {
        // This is the expected behavior, as the constructor is not expecting a null argument.
        verifyException("umd.cs.shop.JSPredicateForm", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateJSPredicateFormTakingStringThrowsError2() throws Throwable  {
        // No Comments were added
        JSPredicateForm jSPredicateForm = null;
        try {
          jSPredicateForm = new JSPredicateForm("goodbye");
          fail("Expecting exception: Error");
        
        } catch(Error e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("umd.cs.shop.JSPredicateForm", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateJSPredicateFormTakingStringThrowsError3() throws Throwable  {
        // No Comments were added
        JSPredicateForm jSPredicateForm = null;
        try {
          jSPredicateForm = new JSPredicateForm("(1 < 5 && 3 > 4)");
          fail("Expecting exception: Error");
        
        } catch(Error e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("umd.cs.shop.JSPredicateForm", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesJSPredicateFormTakingString() throws Throwable  {
        // Given a JSPredicateForm with no initial capacity
        JSPredicateForm jSPredicateForm = new JSPredicateForm((String) null);
        
        // When the capacity is accessed
        int actualCapacity = jSPredicateForm.capacity();
        
        // Then it should have an initial capacity of 10
        assertEquals(10, actualCapacity);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateJSPredicateFormTakingStreamTokenizerThrowsError() throws Throwable  {
        // Create a new instance of JSPredicateForm with null stream tokenizer
        JSPredicateForm jSPredicateForm = null;
        try {
        jSPredicateForm = new JSPredicateForm((StreamTokenizer) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the correct exception is thrown with the correct message
        assertEquals(e.getMessage(), "The stream tokenizer cannot be null");
        verifyException("umd.cs.shop.JSPredicateForm", e);}
    }
  }
  