content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 02:42:36 GMT 2024
   */
  
  package com.pmdesigns.jvc.tools;
  
  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 com.pmdesigns.jvc.tools.JVCParser;
  import com.pmdesigns.jvc.tools.JVCParserTokenManager;
  import com.pmdesigns.jvc.tools.Token;
  import java.io.InputStream;
  import java.io.PipedInputStream;
  import java.io.Reader;
  import java.io.StringReader;
  import java.util.LinkedHashSet;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.testdata.EvoSuiteFile;
  import org.evosuite.runtime.testdata.FileSystemHandling;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class JVCParser_ESTest extends JVCParser_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGenerateParseException() throws Throwable  {
        // Given a StringReader containing the input string "|_KbL" and a JVCParser instance created with that reader
        StringReader arg0 = new StringReader("|_KbL");
        JVCParser jVCParser = new JVCParser(arg0);
        
        // When the getToken() method is called with an argument of 2246
        Token token = jVCParser.getToken(2246);
        
        // Then assert that a non-null Token object is returned
        assertNotNull(token);
        
        // And assert that the kind property of the returned Token object is equal to 0
        assertEquals(0, token.kind);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReInitTaking2Arguments() throws Throwable  {
        // rollbacked to evosuite
        PipedInputStream arg0 = new PipedInputStream(92);
        JVCParser jVCParser = new JVCParser(arg0);
        jVCParser.ReInit((InputStream) arg0, (String) null);
        assertEquals(100, jVCParser.debugColumn);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse() throws Throwable  {
        // No Comments were added
        PipedInputStream arg0 = new PipedInputStream();
        JVCParser jVCParser = new JVCParser(arg0);
        jVCParser.getToken(9);
        String parse = jVCParser.parse();
        assertEquals("", parse);
        assertEquals(100, jVCParser.debugColumn);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNextToken() throws Throwable  {
        // rollbacked to evosuite
        StringReader arg0 = new StringReader("tDKSCPbM.Gt_");
        JVCParser jVCParser = new JVCParser(arg0);
        Token token = jVCParser.getToken(1);
        assertEquals(1, token.endColumn);
        
        Token nextToken = jVCParser.getNextToken();
        assertEquals(100, jVCParser.debugColumn);
        assertNotNull(nextToken);
        assertEquals(1, nextToken.beginLine);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReInitTakingJVCParserTokenManager() throws Throwable  {
        // Create a new instance of the JVCParser class with a null token manager.
        JVCParser jVCParser = new JVCParser((JVCParserTokenManager) null);
        
        // Reinitialize the parser with a null token manager.
        jVCParser.ReInit((JVCParserTokenManager) null);
        
        // Test that the debug column is set to 100.
        assertEquals(100, jVCParser.debugColumn);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReInitTakingReader() throws Throwable  {
        // Given a StringReader containing the string "[[!" and a JVCParser instance initialized with this reader
        StringReader input = new StringReader("[[!");
        JVCParser parser = new JVCParser(input);
        
        // When we re-initialize the parser with the same reader
        parser.ReInit((Reader) input);
        
        // Then the debugColumn property should be set to 100
        assertEquals(100, parser.debugColumn);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsException0() throws Throwable  {
        // No Comments were added
        StringReader arg0 = new StringReader("\"[[=J=\"");
        JVCParser jVCParser = new JVCParser(arg0);
        try { 
          jVCParser.parse();
          fail("Expecting exception: Exception");
        
        } catch(Exception e) {
           //
           // Unbalanced tag at end of null
           //
           verifyException("com.pmdesigns.jvc.tools.JVCParser", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsException1() throws Throwable  {
        // No Comments were added
        StringReader arg0 = new StringReader("\"[[\"");
        JVCParser jVCParser = new JVCParser(arg0);
        try { 
          jVCParser.parse();
          fail("Expecting exception: Exception");
        
        } catch(Exception e) {
           //
           // Unbalanced tag at end of null
           //
           verifyException("com.pmdesigns.jvc.tools.JVCParser", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsException2() throws Throwable  {
        // Given a StringReader containing an unbalanced tag at the end of null
        StringReader arg0 = new StringReader("[[!");
        
        // When parsing the input using JVCParser
        JVCParser jVCParser = new JVCParser(arg0);
        try {
        jVCParser.parse();
        fail("Expecting exception: Exception");
        
        } catch(Exception e) {
        // Then an exception should be thrown because of the unbalanced tag
        verifyException("com.pmdesigns.jvc.tools.JVCParser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesJVCParserTaking3Arguments() throws Throwable  {
        // Given a file with a valid path
        EvoSuiteFile arg0 = new EvoSuiteFile(".ayf UB9JdjD&0DF'e:");
        
        // When we append a string to the file
        FileSystemHandling.appendStringToFile(arg0, "com.pmdesigns.jvc.tools.JVCParserTokenManager");
        
        // Then we expect the debugColumn property of the JVCParser object to be set to 100
        LinkedHashSet<String> arg1 = new LinkedHashSet<String>();
        JVCParser jVCParser = new JVCParser(".ayf UB9JdjD&0DF'e:", arg1, true);
        assertEquals(100, jVCParser.debugColumn);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesJVCParserTaking2Arguments() throws Throwable  {
        // No Comments were added
        EvoSuiteFile arg0 = new EvoSuiteFile(".ayf UB9JdjD&0DF'e:");
        FileSystemHandling.appendStringToFile(arg0, "com.pmdesigns.jvc.tools.JVCParserTokenManager");
        LinkedHashSet<String> arg1 = new LinkedHashSet<String>();
        JVCParser jVCParser = new JVCParser(".ayf UB9JdjD&0DF'e:", arg1);
        assertEquals(100, jVCParser.debugColumn);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMainThrowsNullPointerException0() throws Throwable  {
        // Given
        String[] args = new String[2];
        args[0] = "-debug";
        
        // When
        try {
        JVCParser.main(args);
        fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        // Then
        verifyException("org.evosuite.runtime.mock.java.io.MockFileInputStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMainThrowsNullPointerException1() throws Throwable  {
        // Test that an exception is thrown when the main method is called without arguments
        String[] arg0 = new String[1];
        try {
        JVCParser.main(arg0);
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        // Verify that the exception is thrown when the main method is called without arguments
        verifyException("org.evosuite.runtime.mock.java.io.MockFileInputStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMain() throws Throwable  {
        // rollbacked to evosuite
        String[] arg0 = new String[6];
        JVCParser.main(arg0);
        assertEquals(6, arg0.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMainWithEmptyArray() throws Throwable  {
        // Given: An empty array of arguments is passed to the main method
        String[] args = new String[0];
        
        // When: The main method is called with the empty argument array
        JVCParser.main(args);
        
        // Then: Ensure that the length of the argument array is 0
        assertEquals(0, args.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReInitTakingInputStream() throws Throwable  {
        // Test that the debug column is set to 100 after reinitializing the JVC parser with a piped input stream
        
        PipedInputStream inputStream = new PipedInputStream();
        JVCParser jvcParser = new JVCParser(inputStream);
        jvcParser.ReInit((InputStream) inputStream);
        assertEquals(100, jvcParser.debugColumn);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsException3() throws Throwable  {
        // No Comments were added
        StringReader arg0 = new StringReader("\"[[==\"");
        JVCParser jVCParser = new JVCParser(arg0);
        try { 
          jVCParser.parse();
          fail("Expecting exception: Exception");
        
        } catch(Exception e) {
           //
           // Unbalanced tag at end of null
           //
           verifyException("com.pmdesigns.jvc.tools.JVCParser", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEnable_tracing() throws Throwable  {
        // Given a JVCParser instance with tracing enabled
        JVCParser jVCParser = new JVCParser((JVCParserTokenManager) null);
        jVCParser.enable_tracing();
        
        // When the debug column is set to 100
        jVCParser.debugColumn = 100;
        
        // Then the value of the debug column should be 100
        assertEquals(100, jVCParser.debugColumn);
    }
  }
  