Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

A basic inequality checking assertion...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
notEqual( expected, actual, message );

Parameters

ParameterTypeMandatoryNotesAPI Version
expectedVariant(tick)The expected value.1.0
actualVariant(tick)The actual value.1.0
messageString(tick)A message stating what the assertion is testing.1.0

Return Values

ValueTypeNotesAPI Version
<error>ErrorMost likely the parameters are wrong.1.0
trueBooleanexpected != actual.1.0
falseBooleanexpected == actual.1.0

Example

Code Block
themeRDark
languagejavascript
linenumberstrue
Test("Inequality checks", Test.ANY( ), function(_global, settings) {
	// assertions will fail
	notEqual( true, true, "true != true?" );
	notEqual( undefined, null, "undefined != null?" );
	notEqual( null, false, "null != false?" );
	notEqual( "fish", true, "'fish' != true?" );
	// assertion will pass
	notEqual( true, false, "true != false?" );
});
Div
classbox
Availability
Status
colour
Yellow
Green
title
Beta
Stable

Requires:

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

Test API

Topics:

Child pages (Children Display)
alltrue
depthall
pageTest API
excerpttrue