-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problems when setting values on child elements in primitive arrays (
#1302) * Don't create extra elements on primitive arrays When checking the existing slices on a primitive array, the slice names are on the objects within the underscore-prefixed array. * Maintain parallel arrays for primitives Primitive arrays are represented with two arrays: one that stores the primitive values, and one that stores child elements. When creating an element at a given index in one array, also create an element at the same index in the other. Slice names at a given index should be equal. When resoving soft indices under manual slice ordering, treat "no slice name" as its own group of slices. This helps guarantee correct array indices when assigning child properties of a primitive array. * Code cleanup and additional tests In places where code coverage reported uncovered code, add tests where possible. Some uncovered code represented logically impossible scenarios, so that code is removed. * Fill up new array when creating other half of primitive array A primitive array may start out containing some elements, such as when working with ElementDefinition.type.profile. Fill up the array so that each half is the same size. * Refactor to eliminate "underscored" helper variable * Check for empty error log at end of slice tests * Revert changes to strict soft index resolution Guarantees about not accessing named slices without the slice name only apply when soft indexing is used. The resulting numeric indices, therefore, may be spaced out in order to account for the presence of named slices.
- Loading branch information
1 parent
7d9cbc8
commit 8ef06be
Showing
7 changed files
with
843 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.