Commit 4c5ffd5
committed
fix: prevent duplicate keys in MetadatumMap arbitrary generator
The property-based test generator for MetadatumMap was creating
invalid metadata by allowing duplicate keys (e.g., two empty strings).
When duplicate keys were added to the Map, the second insertion
would overwrite the first, causing a mismatch between the expected
array length and actual Map size.
This caused flaky test failures in AuxiliaryData.CML.test.ts when
comparing Evolution SDK CBOR output with CML CBOR output.
Fixed by using FastCheck.uniqueArray with a selector function that
ensures unique keys based on their string values.
Fixes intermittent CI failures in test/AuxiliaryData.CML.test.ts1 parent 44b1b6c commit 4c5ffd5
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
267 | 270 | | |
268 | 271 | | |
269 | 272 | | |
| |||
0 commit comments