content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 01:47:24 GMT 2024
   */
  
  package com.yahoo.platform.yui.compressor;
  
  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.yahoo.platform.yui.compressor.JavaScriptIdentifier;
  import com.yahoo.platform.yui.compressor.ScriptOrFnScope;
  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 ScriptOrFnScope_ESTest extends ScriptOrFnScope_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIdentifierReturningNonNull() throws Throwable  {
        // Set up a new ScriptOrFnScope with the given ID and parent scope
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope(0, null);
        
        // Declare an identifier with the given name in the script or function scope
        JavaScriptIdentifier declareIdentifier = scriptOrFnScope.declareIdentifier("");
        
        // Get the identifier with the given name from the script or function scope
        JavaScriptIdentifier identifier = scriptOrFnScope.getIdentifier("");
        
        // Assert that the declared and retrieved identifiers are the same
        assertSame(identifier, declareIdentifier);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBraceNestingReturningZero() throws Throwable  {
        // Given: A ScriptOrFnScope object with a brace nesting level of 0
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope(0, (ScriptOrFnScope) null);
        
        // When: The brace nesting level is retrieved
        int braceNesting = scriptOrFnScope.getBraceNesting();
        
        // Then: The brace nesting level should be 0
        assertEquals(0, braceNesting);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBraceNestingReturningPositive() throws Throwable  {
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope(2248, (ScriptOrFnScope) null);
        // Given a script or function scope with brace nesting level 2248
        int expectedBraceNesting = 2248;
        int actualBraceNesting = scriptOrFnScope.getBraceNesting();
        // When the brace nesting level is retrieved
        // Then the expected and actual brace nesting levels should match
        assertEquals(expectedBraceNesting, actualBraceNesting);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDeclareIdentifierAndMunge0() throws Throwable  {
        // rollbacked to evosuite
        ScriptOrFnScope arg1 = new ScriptOrFnScope((-39), (ScriptOrFnScope) null);
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope((-39), arg1);
        scriptOrFnScope.declareIdentifier("var ");
        scriptOrFnScope.munge();
        arg1.munge();
        assertFalse(arg1.equals((Object)scriptOrFnScope));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDeclareIdentifierAndMunge1() throws Throwable  {
        // Given: We have two script or function scopes, one of which is nested within the other
        ScriptOrFnScope outer = new ScriptOrFnScope(2248, (ScriptOrFnScope) null);
        outer.declareIdentifier("new");
        ScriptOrFnScope inner = new ScriptOrFnScope(-5277, outer);
        inner.munge();
        
        // When: We compare the two script or function scopes for equality
        assertFalse(outer.equals((Object)inner));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMungeAndPreventMunging() throws Throwable  {
        // Arrange
        ScriptOrFnScope arg1 = new ScriptOrFnScope(2248, (ScriptOrFnScope) null);
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope((-5277), arg1);
        
        // Act
        scriptOrFnScope.preventMunging();
        scriptOrFnScope.munge();
        
        // Assert
        assertFalse(scriptOrFnScope.equals((Object)arg1));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPreventMunging() throws Throwable  {
        // rollbacked to evosuite
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope(2248, (ScriptOrFnScope) null);
        scriptOrFnScope.preventMunging();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetParentScopeReturningNonNull() throws Throwable  {
        // Given a ScriptOrFnScope object with a parent scope
        ScriptOrFnScope arg1 = new ScriptOrFnScope(333, (ScriptOrFnScope) null);
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope(333, arg1);
        
        // When the getParentScope() method is called on the scriptOrFnScope object
        ScriptOrFnScope parentScope = scriptOrFnScope.getParentScope();
        
        // Then the returned value should be the same as the input arg1
        assertSame(parentScope, arg1);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIncrementVarCount() throws Throwable  {
        // Given: we have a ScriptOrFnScope with an ID of 2248 and no parent scope
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope(2248, null);
        
        // When: the incrementVarCount method is called on the scriptOrFnScope object
        int incrementVarCount = scriptOrFnScope.incrementVarCount();
        
        // Then: we expect the incrementVarCount method to return 1, as it should be the first variable created in this scope
        assertEquals(1, incrementVarCount);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddHint() throws Throwable  {
        // rollbacked to evosuite
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope(2248, (ScriptOrFnScope) null);
        scriptOrFnScope.addHint("'B@$-%]IUj", "'B@$-%]IUj");
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetParentScopeReturningNull() throws Throwable  {
        // Given a ScriptOrFnScope with a parent scope
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope(0, (ScriptOrFnScope) null);
        
        // When we call getParentScope()
        ScriptOrFnScope parentScope = scriptOrFnScope.getParentScope();
        
        // Then the result should be null
        assertNull(parentScope);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIdentifierReturningNull() throws Throwable  {
        // Given: A ScriptOrFnScope with a variable name "myVariable"
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope(0, (ScriptOrFnScope) null);
        
        // When: The getIdentifier method is called with the variable name
        JavaScriptIdentifier identifier = scriptOrFnScope.getIdentifier("myVariable");
        
        // Then: The returned identifier should be null
        assertNull(identifier);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBraceNestingReturningNegative() throws Throwable  {
        // Given: A ScriptOrFnScope object with a negative value for the brace nesting level
        ScriptOrFnScope scriptOrFnScope = new ScriptOrFnScope(-1749, (ScriptOrFnScope) null);
        
        // When: The braceNesting method is called on this object
        int braceNesting = scriptOrFnScope.getBraceNesting();
        
        // Then: The returned value should be the negative value passed to the constructor
        assertEquals(-1749, braceNesting);
    }
  }
  