jstests/core/txns/non_transactional_operations_on_session_with_transaction.js
/**
 * Asserts that the given result cursor has the expected contents and that it is exhausted if
 * specified.
 */
Asserts that the given result cursor has the expected contents and that it is exhausted if
specified.
Asserts that the given result cursor has the expected contents and that it is exhausted if specified .
function assertCursorBatchContents(result, expectedContents, isExhausted) {
    assert.gt(expectedContents.length, 0, "Non-empty expected contents required.");
    assert(result.hasOwnProperty("cursor"), tojson(result));
    assert(result["cursor"].hasOwnProperty("firstBatch"), tojson(result));
    assert.eq(expectedContents.length, result["cursor"]["firstBatch"].length, tojson(result));
    for (let i = 0; i < expectedContents.length; i++) {
        assert.docEq(expectedContents[i], result["cursor"]["firstBatch"][i], tojson(result));
    }
    assert.eq(isExhausted, result["cursor"]["id"] === 0, tojson(result));
}
function assertCursorBatchContents ( result , expectedContents , isExhausted ) { assert . gt ( expectedContents . length , 0 , "Non-empty expected contents required." ) ; assert ( result . hasOwnProperty ( "cursor" ) , tojson ( result ) ) ; assert ( result [ "cursor" ] . hasOwnProperty ( "firstBatch" ) , tojson ( result ) ) ; assert . eq ( expectedContents . length , result [ "cursor" ] [ "firstBatch" ] . length , tojson ( result ) ) ; for ( let i = 0 ; i < expectedContents . length ; i ++ ) { assert . docEq ( expectedContents [ i ] , result [ "cursor" ] [ "firstBatch" ] [ i ] , tojson ( result ) ) ; } assert . eq ( isExhausted , result [ "cursor" ] [ "id" ] === 0 , tojson ( result ) ) ; }
Asserts that the given result cursor has the expected contents and that it is exhausted if
 specified.
Asserts that the given result cursor has the expected contents and that it is exhausted if specified .