# Yahoo! UI Library

### yuitest 2.8.0r4

Yahoo! UI Library > yuitest > YAHOO.util.ComparisonFailure
Search:
Filters Show Private Show Protected Show Deprecated

## Class YAHOO.util.ComparisonFailure - extends YAHOO.util.AssertionError

ComparisonFailure is subclass of AssertionError that is thrown whenever a comparison between two values fails. It provides mechanisms to retrieve both the expected and actual value.

### Constructor

YAHOO.util.ComparisonFailure `( message , expected , actual )`

Parameters:
  `message <String>` The message to display when the error occurs.
  `expected <Object>` The expected value.
  `actual <Object>` The actual value that caused the assertion to fail.

### Properties

#### actual - `Object`

The actual value.

#### expected - `Object`

The expected value.

#### name - `String`

The name of the error that occurred.

#### Properties inherited from YAHOO.util.AssertionError:

`name`

### Methods

#### toString

`String toString ( )`
Returns a fully formatted error for an assertion failure. This message provides information about the expected and actual values.

Returns: `String`
  A string describing the error.

#### Methods inherited from YAHOO.util.AssertionError:

`getMessage, toString`

Copyright © 2009 Yahoo! Inc. All rights reserved.