lib/assert.js
function( actual, expected, prefix ) {
		var self = this, keys, expectedKeys;
		prefix = prefix || '';

		if ( munit.isArray( actual ) && munit.isArray( expected ) ) {
			if ( actual.length !== expected.length ) {
				throw "\nActual: actual" + prefix + ".length = " + actual.length +
					"\nExpected: expected" + prefix + ".length = " + expected.length;
			}

			munit.each( actual, function( item, i ) {
				if ( munit.isArray( item ) || munit.isObject( item ) ) {
					self._objectMatch( item, expected[ i ], prefix + "[" + i + "]" );
				}
				else if ( item !== expected[ i ] ) {
					throw "\nActual: actual" + prefix + "[" + i + "] = " + item +
						"\nExpected: expected" + prefix + "[" + i + "] = " + expected[ i ];
				}
			});
		}
		else if ( munit.isObject( actual ) && munit.isObject( expected ) ) {
			keys = Object.keys( actual );
			expectedKeys = Object.keys( expected );

			if ( keys.length !== expectedKeys.length ) {
				throw "\nActual: actual" + prefix + ".length = " + keys.length +
					"\nExpected: expected" + prefix + ".length = " + expectedKeys.length;
			}

			munit.each( keys, function( key ) {
				var item = actual[ key ];

				if ( munit.isArray( item ) || munit.isObject( item ) ) {
					self._objectMatch( item, expected[ key ], prefix + "[" + key + "]" );
				}
				else if ( item !== expected[ key ] ) {
					throw "\nActual: actual" + prefix + "[" + key + "] = " + item +
						"\nExpected: expected" + prefix + "[" + key + "] = " + expected[ key ];
				}
			});
		}
		else if ( actual !== expected ) {
			throw "\nActual: actual" + prefix + " = " + actual +
				"\nExpected: expected" + prefix + " = " + expected;
		}
	}
function( actual, expected, prefix ) {
		var self = this, keys, expectedKeys;
		prefix = prefix || '';

		if ( munit.isArray( actual ) && munit.isArray( expected ) ) {
			if ( actual.length !== expected.length ) {
				throw "\nActual: actual" + prefix + ".length = " + actual.length +
					"\nExpected: expected" + prefix + ".length = " + expected.length;
			}

			munit.each( actual, function( item, i ) {
				if ( munit.isArray( item ) || munit.isObject( item ) ) {
					self._objectMatch( item, expected[ i ], prefix + "[" + i + "]" );
				}
				else if ( item !== expected[ i ] ) {
					throw "\nActual: actual" + prefix + "[" + i + "] = " + item +
						"\nExpected: expected" + prefix + "[" + i + "] = " + expected[ i ];
				}
			});
		}
		else if ( munit.isObject( actual ) && munit.isObject( expected ) ) {
			keys = Object.keys( actual );
			expectedKeys = Object.keys( expected );

			if ( keys.length !== expectedKeys.length ) {
				throw "\nActual: actual" + prefix + ".length = " + keys.length +
					"\nExpected: expected" + prefix + ".length = " + expectedKeys.length;
			}

			munit.each( keys, function( key ) {
				var item = actual[ key ];

				if ( munit.isArray( item ) || munit.isObject( item ) ) {
					self._objectMatch( item, expected[ key ], prefix + "[" + key + "]" );
				}
				else if ( item !== expected[ key ] ) {
					throw "\nActual: actual" + prefix + "[" + key + "] = " + item +
						"\nExpected: expected" + prefix + "[" + key + "] = " + expected[ key ];
				}
			});
		}
		else if ( actual !== expected ) {
			throw "\nActual: actual" + prefix + " = " + actual +
				"\nExpected: expected" + prefix + " = " + expected;
		}
	}
function ( actual , expected , prefix ) { var self = this , keys , expectedKeys ; prefix = prefix || '' ; if ( munit . isArray ( actual ) && munit . isArray ( expected ) ) { if ( actual . length !== expected . length ) { throw "\nActual: actual" + prefix + ".length = " + actual . length + "\nExpected: expected" + prefix + ".length = " + expected . length ; } munit . each ( actual , function ( item , i ) { if ( munit . isArray ( item ) || munit . isObject ( item ) ) { self . _objectMatch ( item , expected [ i ] , prefix + "[" + i + "]" ) ; } else if ( item !== expected [ i ] ) { throw "\nActual: actual" + prefix + "[" + i + "] = " + item + "\nExpected: expected" + prefix + "[" + i + "] = " + expected [ i ] ; } } ) ; } else if ( munit . isObject ( actual ) && munit . isObject ( expected ) ) { keys = Object . keys ( actual ) ; expectedKeys = Object . keys ( expected ) ; if ( keys . length !== expectedKeys . length ) { throw "\nActual: actual" + prefix + ".length = " + keys . length + "\nExpected: expected" + prefix + ".length = " + expectedKeys . length ; } munit . each ( keys , function ( key ) { var item = actual [ key ] ; if ( munit . isArray ( item ) || munit . isObject ( item ) ) { self . _objectMatch ( item , expected [ key ] , prefix + "[" + key + "]" ) ; } else if ( item !== expected [ key ] ) { throw "\nActual: actual" + prefix + "[" + key + "] = " + item + "\nExpected: expected" + prefix + "[" + key + "] = " + expected [ key ] ; } } ) ; } else if ( actual !== expected ) { throw "\nActual: actual" + prefix + " = " + actual + "\nExpected: expected" + prefix + " = " + expected ; } }
Key matching for object match
Key matching for object match