Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54152

Clarify usage guidance for arrayEq, orderedArrayEq, documentEq jstest helpers

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.9.0
    • None
    • Fully Compatible

    Description

      It looks like we don't need arrayEq and orderedArrayEq, because all the calls happen directly in an assert():

      assert(arrayEq(a, b));
      assert(orderedArrayEq(x, y));
      

      When should we use these assertion methods instead:

      assert.sameMembers(a, b);
      assert.eq(x, y);
      

      The assertion methods have better error messages by default: it can print the two values.

      We should consider what else in jstests/aggregation/extras/utils.js can be removed, or moved to src/mongo/shell/assert.js.

      Attachments

        Activity

          People

            milena.ivanova@mongodb.com Milena Ivanova
            david.percy@mongodb.com David Percy
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: