diff -r 322d0feea350 -r 89ef5ed3c48b src/cm/media/js/lib/yui/yui_3.10.3/api/classes/Test.ArrayAssert.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/media/js/lib/yui/yui_3.10.3/api/classes/Test.ArrayAssert.html Tue Jul 16 14:29:46 2013 +0200 @@ -0,0 +1,3775 @@ + + + + + Test.ArrayAssert - YUI 3 + + + + + + + + +
+
+
+ +

+ +
+
+ API Docs for: 3.10.3 +
+
+
+ +
+ +
+
+
+ Show: + + + + + + + +
+ + +
+
+
+

Test.ArrayAssert Class

+
+ + + + + +
+ Defined in: test/js/ArrayAssert.js:2 +
+ + + + + Module: test + + + + +
+ + + +
+

The ArrayAssert object provides functions to test JavaScript array objects +for a variety of cases.

+
+ + + +
+ + +
+
+

Item Index

+ + +
+

Methods

+ + +
+ + + + + + + +
+ + +
+

Methods

+ + +
+

_indexOf

+ + +
+ (
    + +
  • + + haystack + +
  • + +
  • + + needle + +
  • + +
) +
+ + + + + Int + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:17 + +

+ + + + + +
+ +
+

Simple indexOf() implementation for an array. Defers to native +if available.

+
+ + +
+

Parameters:

+ +
    + +
  • + + haystack + Array + + + + +
    +

    The array to search.

    +
    + + +
  • + +
  • + + needle + Variant + + + + +
    +

    The value to locate.

    +
    + + +
  • + +
+
+ + + +
+

Returns:

+ +
+ + + Int: + + The index of the needle if found or -1 if not. + +
+
+ + + +
+ + +
+

_some

+ + +
+ (
    + +
  • + + haystack + +
  • + +
  • + + matcher + +
  • + +
) +
+ + + + + Boolean + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:39 + +

+ + + + + +
+ +
+

Simple some() implementation for an array. Defers to native +if available.

+
+ + +
+

Parameters:

+ +
    + +
  • + + haystack + Array + + + + +
    +

    The array to search.

    +
    + + +
  • + +
  • + + matcher + Function + + + + +
    +

    The function to run on each value.

    +
    + + +
  • + +
+
+ + + +
+

Returns:

+ +
+ + + Boolean: + + True if any value, when run through the matcher, + returns true. + +
+
+ + + +
+ + +
+

contains

+ + +
+ (
    + +
  • + + needle + +
  • + +
  • + + haystack + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:62 + +

+ + + + + +
+ +
+

Asserts that a value is present in an array. This uses the triple equals +sign so no type coercion may occur.

+
+ + +
+

Parameters:

+ +
    + +
  • + + needle + Object + + + + +
    +

    The value that is expected in the array.

    +
    + + +
  • + +
  • + + haystack + Array + + + + +
    +

    An array of values.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

containsItems

+ + +
+ (
    + +
  • + + needles + +
  • + +
  • + + haystack + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:81 + +

+ + + + + +
+ +
+

Asserts that a set of values are present in an array. This uses the triple equals +sign so no type coercion may occur. For this assertion to pass, all values must +be found.

+
+ + +
+

Parameters:

+ +
    + +
  • + + needles + Object[] + + + + +
    +

    An array of values that are expected in the array.

    +
    + + +
  • + +
  • + + haystack + Array + + + + +
    +

    An array of values to check.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

containsMatch

+ + +
+ (
    + +
  • + + matcher + +
  • + +
  • + + haystack + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:103 + +

+ + + + + +
+ +
+

Asserts that a value matching some condition is present in an array. This uses +a function to determine a match.

+
+ + +
+

Parameters:

+ +
    + +
  • + + matcher + Function + + + + +
    +

    A function that returns true if the items matches or false if not.

    +
    + + +
  • + +
  • + + haystack + Array + + + + +
    +

    An array of values.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

doesNotContain

+ + +
+ (
    + +
  • + + needle + +
  • + +
  • + + haystack + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:126 + +

+ + + + + +
+ +
+

Asserts that a value is not present in an array. This uses the triple equals +Asserts that a value is not present in an array. This uses the triple equals +sign so no type coercion may occur.

+
+ + +
+

Parameters:

+ +
    + +
  • + + needle + Object + + + + +
    +

    The value that is expected in the array.

    +
    + + +
  • + +
  • + + haystack + Array + + + + +
    +

    An array of values.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

doesNotContainItems

+ + +
+ (
    + +
  • + + needles + +
  • + +
  • + + haystack + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:146 + +

+ + + + + +
+ +
+

Asserts that a set of values are not present in an array. This uses the triple equals +sign so no type coercion may occur. For this assertion to pass, all values must +not be found.

+
+ + +
+

Parameters:

+ +
    + +
  • + + needles + Object[] + + + + +
    +

    An array of values that are not expected in the array.

    +
    + + +
  • + +
  • + + haystack + Array + + + + +
    +

    An array of values to check.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

doesNotContainMatch

+ + +
+ (
    + +
  • + + matcher + +
  • + +
  • + + haystack + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:169 + +

+ + + + + +
+ +
+

Asserts that no values matching a condition are present in an array. This uses +a function to determine a match.

+
+ + +
+

Parameters:

+ +
    + +
  • + + matcher + Function + + + + +
    +

    A function that returns true if the item matches or false if not.

    +
    + + +
  • + +
  • + + haystack + Array + + + + +
    +

    An array of values.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

indexOf

+ + +
+ (
    + +
  • + + needle + +
  • + +
  • + + haystack + +
  • + +
  • + + index + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:193 + +

+ + + + + +
+ +
+

Asserts that the given value is contained in an array at the specified index. +This uses the triple equals sign so no type coercion will occur.

+
+ + +
+

Parameters:

+ +
    + +
  • + + needle + Object + + + + +
    +

    The value to look for.

    +
    + + +
  • + +
  • + + haystack + Array + + + + +
    +

    The array to search in.

    +
    + + +
  • + +
  • + + index + Int + + + + +
    +

    The index at which the value should exist.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

isEmpty

+ + +
+ (
    + +
  • + + actual + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:292 + +

+ + + + + +
+ +
+

Asserts that an array is empty.

+
+ + +
+

Parameters:

+ +
    + +
  • + + actual + Array + + + + +
    +

    The array to test.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

isNotEmpty

+ + +
+ (
    + +
  • + + actual + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:306 + +

+ + + + + +
+ +
+

Asserts that an array is not empty.

+
+ + +
+

Parameters:

+ +
    + +
  • + + actual + Array + + + + +
    +

    The array to test.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

itemsAreEqual

+ + +
+ (
    + +
  • + + expected + +
  • + +
  • + + actual + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:221 + +

+ + + + + +
+ +
+

Asserts that the values in an array are equal, and in the same position, +as values in another array. This uses the double equals sign +so type coercion may occur. Note that the array objects themselves +need not be the same for this test to pass.

+
+ + +
+

Parameters:

+ +
    + +
  • + + expected + Array + + + + +
    +

    An array of the expected values.

    +
    + + +
  • + +
  • + + actual + Array + + + + +
    +

    Any array of the actual values.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

itemsAreEquivalent

+ + +
+ (
    + +
  • + + expected + +
  • + +
  • + + actual + +
  • + +
  • + + comparator + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + Void + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:255 + +

+ + + + + +
+ +
+

Asserts that the values in an array are equivalent, and in the same position, +as values in another array. This uses a function to determine if the values +are equivalent. Note that the array objects themselves +need not be the same for this test to pass.

+
+ + +
+

Parameters:

+ +
    + +
  • + + expected + Array + + + + +
    +

    An array of the expected values.

    +
    + + +
  • + +
  • + + actual + Array + + + + +
    +

    Any array of the actual values.

    +
    + + +
  • + +
  • + + comparator + Function + + + + +
    +

    A function that returns true if the values are equivalent + or false if not.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + +
+

Returns:

+ +
+ + + Void: + + +
+
+ + + +
+ + +
+

itemsAreSame

+ + +
+ (
    + +
  • + + expected + +
  • + +
  • + + actual + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:320 + +

+ + + + + +
+ +
+

Asserts that the values in an array are the same, and in the same position, +as values in another array. This uses the triple equals sign +so no type coercion will occur. Note that the array objects themselves +need not be the same for this test to pass.

+
+ + +
+

Parameters:

+ +
    + +
  • + + expected + Array + + + + +
    +

    An array of the expected values.

    +
    + + +
  • + +
  • + + actual + Array + + + + +
    +

    Any array of the actual values.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

lastIndexOf

+ + +
+ (
    + +
  • + + needle + +
  • + +
  • + + haystack + +
  • + +
  • + + index + +
  • + +
  • + + message + +
  • + +
) +
+ + + + + + + + + + + + static + + + + + + +
+ + + +

+ + Defined in + + + + + test/js/ArrayAssert.js:349 + +

+ + + + + +
+ +
+

Asserts that the given value is contained in an array at the specified index, +starting from the back of the array. +This uses the triple equals sign so no type coercion will occur.

+
+ + +
+

Parameters:

+ +
    + +
  • + + needle + Object + + + + +
    +

    The value to look for.

    +
    + + +
  • + +
  • + + haystack + Array + + + + +
    +

    The array to search in.

    +
    + + +
  • + +
  • + + index + Int + + + + +
    +

    The index at which the value should exist.

    +
    + + +
  • + +
  • + + message + String + + + + +
    +

    (Optional) The message to display if the assertion fails.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+ + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + +