com.google.javascript.rhino.testing
Class Asserts

java.lang.Object
  extended by com.google.javascript.rhino.testing.Asserts

public class Asserts
extends Object

Helper methods for making assertions about the validity of types.


Method Summary
static void assertEquivalenceOperations(JSType a, JSType b)
          For the given equivalent types, run all type operations that should have trivial solutions (getGreatestSubtype, isEquivalentTo, etc)
static JSType assertResolvesToSame(JSType type)
           
static void assertTypeEquals(JSType a, JSType b)
           
static void assertTypeEquals(String message, JSType a, JSType b)
           
static void assertTypeNotEquals(JSType a, JSType b)
           
static void assertTypeNotEquals(String message, JSType a, JSType b)
           
static JSType assertValidResolve(JSType type)
           
static JSType assertValidResolve(JSType type, StaticScope<JSType> scope)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertResolvesToSame

public static JSType assertResolvesToSame(JSType type)

assertValidResolve

public static JSType assertValidResolve(JSType type)
Returns:
The resolved type

assertValidResolve

public static JSType assertValidResolve(JSType type,
                                        StaticScope<JSType> scope)
Returns:
The resolved type

assertTypeNotEquals

public static void assertTypeNotEquals(JSType a,
                                       JSType b)

assertTypeNotEquals

public static void assertTypeNotEquals(String message,
                                       JSType a,
                                       JSType b)

assertTypeEquals

public static void assertTypeEquals(JSType a,
                                    JSType b)

assertTypeEquals

public static void assertTypeEquals(String message,
                                    JSType a,
                                    JSType b)

assertEquivalenceOperations

public static void assertEquivalenceOperations(JSType a,
                                               JSType b)
For the given equivalent types, run all type operations that should have trivial solutions (getGreatestSubtype, isEquivalentTo, etc)