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 feature parity #400

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. Parameterized test cases with clearer coverage
  2. Updated unit test cases with more intentional coverage
  3. 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]
  4. Ability to escape array style access in key names (ex: key name -> "key1[0]", alternate path -> "key1[0]"
  5. Reducing reliance on brittle regex by implementing string manipulation logic
  6. Removal of the test helper method getAnyCodableAndPayload in favor of using AnyCodable's dictionary representation directly

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

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist: