adobe / aepsdk-edge-ios

Adobe Experience Platform Edge Network mobile extension in Swift
Apache License 2.0
13 stars 24 forks source link

JSON comparison parity (utility only) #401

Closed timkimadobe closed 1 year ago

timkimadobe commented 1 year ago

Description

This PR updates the JSON comparison system to be in line with the Android implementation, taking the following improvements:

  1. Streamlined flexible array comparison logic
    • General wildcard [*] overrides all other alternate paths
    • Precedence: general wildcard [*] > specific index [0] > unspecified index (no alternate path) > wildcard index [*0]
  2. Ability to escape array style access in key names (ex: key name -> "key1[0]", alternate path -> "key1[0]"
  3. Reducing reliance on brittle regex by implementing string manipulation logic
  4. Removal of the test helper method getAnyCodableAndPayload in favor of using AnyCodable's dictionary representation directly
  5. Removal of defunct AssertMode and PayloadType enums

For reference, please see the Android implementation: https://github.com/adobe/aepsdk-edge-android/pull/79

Note that the unit and parameterized tests are not implemented in this PR to facilitate easier review process and will be implemented in followup PRs

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

codecov[bot] commented 1 year ago

Codecov Report

Merging #401 (04d1708) into feature/json-comparison-parity (c3ce8a6) will not change coverage. The diff coverage is n/a.

@@                       Coverage Diff                       @@
##           feature/json-comparison-parity     #401   +/-   ##
===============================================================
  Coverage                           96.77%   96.77%           
===============================================================
  Files                                  27       27           
  Lines                                1671     1671           
===============================================================
  Hits                                 1617     1617           
  Misses                                 54       54