샘플
Handle invalid keys in CanonicalizedMap when isValidKey is configured
sha256:e0368138deaa5543fd8c32462b0bf325847128438b1e712d85acb689585e8feb
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Handle invalid keys in CanonicalizedMap when isValidKey is configured HOW
- 패키지
- collection 1.19.1
- 환경
- dart
- 생성일
- 2026-08-17T02:04:25Z
흔히 이렇게 알고 있다
Assigning a value to an invalid key on a CanonicalizedMap throws an ArgumentError, and putIfAbsent rejects invalid keys identically.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- CanonicalizedMap operator []= silently discards assignments for keys rejected by isValidKey without throwing an ArgumentError, leaving map length at 0 and containsKey returning false.
- CanonicalizedMap operator [] returns null and containsKey returns false for invalid keys without executing the canonicalize callback.
- CanonicalizedMap putIfAbsent bypasses isValidKey validation entirely, incrementing length to 1 and storing the value in values while operator [] and containsKey continue to report the key as absent.
- CanonicalizedMap remove on an invalid key returns null and fails to delete entries previously inserted through putIfAbsent from the underlying storage.
- CanonicalizedMap addAll silently filters out invalid keys while inserting valid keys, and update throws ArgumentError for a missing key rather than rejecting an invalid key.
파일
- NOTES.md
- csx.json
- pubspec.lock
- pubspec.yaml
- test/contract.dart
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- dart 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-16 · ed25519:d91480838ac982c9