com.google.caja.ancillary.linter
Class VariableLivenessTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.google.caja.util.CajaTestCase
              extended by com.google.caja.ancillary.linter.VariableLivenessTest
All Implemented Interfaces:
junit.framework.Test

public class VariableLivenessTest
extends CajaTestCase

Author:
mikesamuel@gmail.com

Field Summary
 
Fields inherited from class com.google.caja.util.CajaTestCase
is, mc, mq, SEED
 
Constructor Summary
VariableLivenessTest()
           
 
Method Summary
private static void assertLiveness(ParseTreeNode js, java.lang.String... golden)
           
private static ExitModes setup(ParseTreeNode js)
           
 void testAnonymousFunctions()
           
 void testBreaksAndContinues()
           
 void testConditionWithElse1()
           
 void testConditionWithElse2()
           
 void testConditionWithoutElse()
           
 void testConditionWithReturn()
           
 void testDirectives()
           
 void testDoWhileLoop()
           
 void testForEachLoop()
           
 void testForLoop()
           
 void testForLoopThatDoesNotComplete()
           
 void testFunctionBody()
           
 void testLiveBreaks()
           
 void testLogicOps()
           
 void testLoopLabels()
           
 void testSimpleAssignment()
           
 void testSimpleDeclaration()
           
 void testSwitchAllBreak()
           
 void testSwitchNoCases()
           
 void testSwitchStmtWithDefault()
           
 void testSwitchStmtWithNonCompletingDefault()
           
 void testSwitchStmtWithoutDefault()
           
 void testTernaryOp()
           
 void testTryAlwaysThrows()
           
 void testTryAndCatchBreak()
           
 void testTryCatch()
           
 void testTryCatchFinally()
           
 void testTryCatchWithReturn()
           
 void testTryFinally()
           
 void testTryReturns()
           
 void testUnreachableCode1()
           
 void testUnreachableCode2()
           
 void testWhileLoop()
           
 void testWithBlock()
           
 
Methods inherited from class com.google.caja.util.CajaTestCase
assertArrayEquals, assertCloneable, assertDeepEquals, assertMessage, assertMessage, assertMessagesLessSevereThan, assertNoErrors, assertNoMessage, assertNoWarnings, checkHeadless, css, css, cssDecls, cssDecls, dataFromResource, formatShort, fromResource, fromResource, fromString, fromString, fromString, html, htmlFragment, js, js, js, jsExpr, jsExpr, markup, markupFragment, minify, plain, quasi, render, render, renderProgram, runTest, setUp, tearDown, xml, xmlFragment
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableLivenessTest

public VariableLivenessTest()
Method Detail

testSimpleDeclaration

public final void testSimpleDeclaration()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

testSimpleAssignment

public final void testSimpleAssignment()
                                throws java.lang.Exception
Throws:
java.lang.Exception

testConditionWithElse1

public final void testConditionWithElse1()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testConditionWithElse2

public final void testConditionWithElse2()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testConditionWithoutElse

public final void testConditionWithoutElse()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

testConditionWithReturn

public final void testConditionWithReturn()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

testTernaryOp

public final void testTernaryOp()
                         throws java.lang.Exception
Throws:
java.lang.Exception

testForLoop

public final void testForLoop()
                       throws java.lang.Exception
Throws:
java.lang.Exception

testForLoopThatDoesNotComplete

public final void testForLoopThatDoesNotComplete()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

testForEachLoop

public final void testForEachLoop()
                           throws java.lang.Exception
Throws:
java.lang.Exception

testDoWhileLoop

public final void testDoWhileLoop()
                           throws java.lang.Exception
Throws:
java.lang.Exception

testWhileLoop

public final void testWhileLoop()
                         throws java.lang.Exception
Throws:
java.lang.Exception

testTryCatchFinally

public final void testTryCatchFinally()
                               throws java.lang.Exception
Throws:
java.lang.Exception

testTryCatch

public final void testTryCatch()
                        throws java.lang.Exception
Throws:
java.lang.Exception

testTryCatchWithReturn

public final void testTryCatchWithReturn()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testTryFinally

public final void testTryFinally()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testTryAndCatchBreak

public final void testTryAndCatchBreak()
                                throws java.lang.Exception
Throws:
java.lang.Exception

testTryReturns

public final void testTryReturns()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testTryAlwaysThrows

public final void testTryAlwaysThrows()
                               throws java.lang.Exception
Throws:
java.lang.Exception

testSwitchStmtWithDefault

public final void testSwitchStmtWithDefault()
                                     throws java.lang.Exception
Throws:
java.lang.Exception

testSwitchStmtWithNonCompletingDefault

public final void testSwitchStmtWithNonCompletingDefault()
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

testSwitchStmtWithoutDefault

public final void testSwitchStmtWithoutDefault()
                                        throws java.lang.Exception
Throws:
java.lang.Exception

testSwitchAllBreak

public final void testSwitchAllBreak()
                              throws java.lang.Exception
Throws:
java.lang.Exception

testSwitchNoCases

public final void testSwitchNoCases()
                             throws java.lang.Exception
Throws:
java.lang.Exception

testFunctionBody

public final void testFunctionBody()
                            throws java.lang.Exception
Throws:
java.lang.Exception

testBreaksAndContinues

public final void testBreaksAndContinues()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testAnonymousFunctions

public final void testAnonymousFunctions()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testWithBlock

public final void testWithBlock()
                         throws java.lang.Exception
Throws:
java.lang.Exception

testUnreachableCode1

public final void testUnreachableCode1()
                                throws java.lang.Exception
Throws:
java.lang.Exception

testUnreachableCode2

public final void testUnreachableCode2()
                                throws java.lang.Exception
Throws:
java.lang.Exception

testLoopLabels

public final void testLoopLabels()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testLogicOps

public final void testLogicOps()
                        throws java.lang.Exception
Throws:
java.lang.Exception

testLiveBreaks

public final void testLiveBreaks()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testDirectives

public final void testDirectives()
                          throws java.lang.Exception
Throws:
java.lang.Exception

setup

private static ExitModes setup(ParseTreeNode js)

assertLiveness

private static void assertLiveness(ParseTreeNode js,
                                   java.lang.String... golden)


Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0