content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 14:14:44 GMT 2024
   */
  
  package com.google.javascript.jscomp.parsing;
  
  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 com.google.javascript.jscomp.parsing.JsDocInfoParser;
  import com.google.javascript.rhino.Node;
  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 JsDocInfoParser_ESTest extends JsDocInfoParser_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringWithNonEmptyString() throws Throwable  {
        // Given a type string "undefined"
        String typeString = "undefined";
        
        // When the method JsDocInfoParser.parseTypeString is called with this string
        Node parseTypeString = JsDocInfoParser.parseTypeString(typeString);
        
        // Then the returned value should not be null
        assertNotNull(parseTypeString);
        
        // And the source position of the node should be 0
        assertEquals(0, parseTypeString.getSourcePosition());
        
        // And the type of the node should be 40 (which represents an undefined type)
        assertEquals(40, parseTypeString.getType());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeString() throws Throwable  {
        // Given a type string "null"
        String input = "null";
        
        // When parsing the type string
        Node parseTypeString = JsDocInfoParser.parseTypeString(input);
        
        // Then the result should be a non-null node
        assertNotNull(parseTypeString);
        
        // And the source position of the node should be 0
        assertEquals(0, parseTypeString.getSourcePosition());
        
        // And the length of the node should be 4
        assertEquals(4, parseTypeString.getLength());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNodeWhereWasEmptyNodeIsFalseAndNodeWhereHasMoreThanOneChildIsFalse0() throws Throwable  {
        // Given: A type string that contains a newline character
        String typeString = "{do}\n";
        
        // When: The type string is parsed using the parseTypeString method
        Node parseTypeString = JsDocInfoParser.parseTypeString(typeString);
        
        // Then: The resulting node should have a child count of 1
        assertEquals(1, parseTypeString.getChildCount());
        
        // And: The resulting node's type should be 309 (JSDOC_TYPE)
        assertEquals(309, parseTypeString.getType());
        
        // And: The resulting node should not be null
        assertNotNull(parseTypeString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNull0() throws Throwable  {
        // Parse a type string that contains an invalid character
        Node parseTypeString = JsDocInfoParser.parseTypeString("{Bz98GO#P:l");
        
        // Assert that the parsed type string is null, indicating that it was not able to be successfully parsed
        assertNull(parseTypeString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNull1() throws Throwable  {
        // No Comments were added
        Node parseTypeString = JsDocInfoParser.parseTypeString("[\n");
        assertNull(parseTypeString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNodeWhereWasEmptyNodeIsFalseAndNodeWhereHasMoreThanOneChildIsFalse1() throws Throwable  {
        // rollbacked to evosuite
        Node parseTypeString = JsDocInfoParser.parseTypeString("(\"#F){cT/`dhP54");
        assertEquals(301, parseTypeString.getType());
        assertTrue(parseTypeString.hasOneChild());
        assertNotNull(parseTypeString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNodeWhereIsFunctionIsTrue() throws Throwable  {
        // No Comments were added
        Node parseTypeString = JsDocInfoParser.parseTypeString("function(string): string[]");
        assertNotNull(parseTypeString);
        assertFalse(parseTypeString.hasOneChild());
        assertEquals(105, parseTypeString.getType());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNull2() throws Throwable  {
        // Test that parseTypeString returns null for a function type string without a closing parenthesis
        Node parseTypeString = JsDocInfoParser.parseTypeString("function (");
        assertNull(parseTypeString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNull3() throws Throwable  {
        // No Comments were added
        Node parseTypeString = JsDocInfoParser.parseTypeString("function");
        assertNull(parseTypeString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNodeWhereWasEmptyNodeIsFalseAndNodeWhereHasMoreThanOneChildIsTrue0() throws Throwable  {
        // rollbacked to evosuite
        Node parseTypeString = JsDocInfoParser.parseTypeString("string|number|boolean|null");
        assertEquals(4, parseTypeString.getChildCount());
        assertNotNull(parseTypeString);
        assertEquals(301, parseTypeString.getType());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNull4() throws Throwable  {
        // No Comments were added
        Node parseTypeString = JsDocInfoParser.parseTypeString("function (a: string, b: number)");
        assertNull(parseTypeString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNull5() throws Throwable  {
        // Parse a type string with invalid syntax
        Node parseTypeString = JsDocInfoParser.parseTypeString("{)^N l");
        
        // Assert that parsing resulted in null
        assertNull(parseTypeString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNodeWhereGetCharnoIsZero() throws Throwable  {
        // Given a type string "*", we want to parse it using JsDocInfoParser.
        Node parseTypeString = JsDocInfoParser.parseTypeString("*");
        
        // When the string is parsed, we expect the result to be not null.
        assertNotNull(parseTypeString);
        
        // And we also expect the type of the parsed node to be equal to 302.
        assertEquals(302, parseTypeString.getType());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNull6() throws Throwable  {
        // rollbacked to evosuite
        Node parseTypeString = JsDocInfoParser.parseTypeString("[ooCam'/E+!qA+*");
        assertNull(parseTypeString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNodeWhereWasEmptyNodeIsFalseAndNodeWhereHasMoreThanOneChildIsFalse2() throws Throwable  {
        // Test that we can successfully parse a valid type string
        Node parseTypeString = JsDocInfoParser.parseTypeString("pcB9?g;;CJ%6");
        assertNotNull(parseTypeString);
        
        // Test that the parsed type is correct
        assertEquals(304, parseTypeString.getType());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNull7() throws Throwable  {
        // Test that a null value is returned when the input type string is "?|"
        Node parseTypeString = JsDocInfoParser.parseTypeString("?|");
        assertNull(parseTypeString);
        
        // The purpose of this test is to verify that the input type string "?|" is correctly parsed as a null value.
        // The method being tested is JsDocInfoParser.parseTypeString, and it returns an instance of Node representing the input type string.
        // When the input type string is "?|", we expect the returned value to be null, since this represents an optional type.
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNodeWhereGetChildCountIsZeroAndNodeWhereHasChildrenIsFalse() throws Throwable  {
        // When the method JsDocInfoParser.parseTypeString is called with this input string
        // Then the output of the method should be a non-null instance of Node
        Node parseTypeString = JsDocInfoParser.parseTypeString("?}P:ITU6U2bc|T`D&<+a");
        assertNotNull(parseTypeString); // Assert that the output is not null
        
        // Given the input string "?}P:ITU6U2bc|T`D&<+a"
        // When the method JsDocInfoParser.parseTypeString is called with this input string
        // Then the type of the output should be 304
        assertEquals(304, parseTypeString.getType()); // Assert that the type is 304
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNull8() throws Throwable  {
        // Test that the method returns null when given an invalid type string.
        Node parseTypeString = JsDocInfoParser.parseTypeString("(NLkjX,WDb(|R%{pK");
        assertNull(parseTypeString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNodeWhereWasEmptyNodeIsFalseAndNodeWhereHasMoreThanOneChildIsTrue1() throws Throwable  {
        // Parse the type string and verify that it is not null
        Node parseTypeString = JsDocInfoParser.parseTypeString("[\"string\", \"number\", \"boolean\"]");
        assertNotNull(parseTypeString);
        
        // Verify that the parsed type string has three children
        assertEquals(3, parseTypeString.getChildCount());
        
        // Verify that the type of the parsed type string is a list
        assertEquals(308, parseTypeString.getType());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTypeStringReturningNull9() throws Throwable  {
        // No Comments were added
        Node parseTypeString = JsDocInfoParser.parseTypeString("?");
        assertNull(parseTypeString);
    }
  }
  