Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2298

Tests that compare JSON should ignore the order by sorting

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Built-in functions
    • Labels:
      None

      Description

      The following tests broke when I switched the variables table from RBTree to Map (hash table) for #3878, because a hash table by definition is not an ordered data structure.

      • ./01_vars/02_functions/getindices_returns_expected_list_from_array.cf
      • ./01_vars/02_functions/maparray_mapdata.cf

      Ideally JSON should be output in sorted order. This requires deep changes in @sort()@ to be able to arbitrarily sort data containers. Assigning to Ted as discussed on IRC.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tzz Ted Zlatanov
                Reporter:
                a10038 jimis (Dimitrios Apostolou)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel