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

Clarify usage guidance for arrayEq, orderedArrayEq, documentEq jstest helpers

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible

      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.

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

              Created:
              Updated:
              Resolved: