[tizen_bundle] Add integration tests#1051
Conversation
- Bundle() default constructor: creates empty bundle with length 0, isEmpty, isNotEmpty, keys empty - Bundle.fromMap: creates empty bundle from empty map - Bundle.fromBundle copy independence: mutating original does not affect copy; adding to copy does not affect original - Bundle.decode: round-trips List<String>, Uint8List, and mixed types through encode/decode - operator[] (get): returns null for missing/null key, returns updated value, idempotent reads - operator[]= (set): throws ArgumentError for unsupported type, stores empty string, single-element list, empty Uint8List, full byte range 0x00–0xff - remove(): no-op for null, throws PlatformException for non-existent key, state transition after add/remove - clear(): idempotent on empty bundle, removes all mixed-type entries - length/isEmpty/isNotEmpty: reflect correct counts through add/remove operations - inherited MapMixin: containsKey, containsValue, entries, forEach, addAll, putIfAbsent
Update integration test suite to 37 test cases.
There was a problem hiding this comment.
Code Review
This pull request updates the integration test suite for the tizen_bundle package, replacing the previous test file with a comprehensive set of 37 test cases covering constructors, operators, state transitions, and inherited MapMixin members. Feedback suggests updating the remove method to return normally instead of throwing a PlatformException when a key is missing, aligning with the standard Dart Map contract. Additionally, it is recommended to add a test verifying that the keys property of different Bundle instances remains independent.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Fix remove() to be a no-op when the key does not exist, matching the standard Map.remove() contract. Previously, removing a non-existent key threw a PlatformException (BUNDLE_ERROR_KEY_NOT_AVAILABLE). Fix the keys getter to return an independent list per call. Previously, it returned a reference to a shared static list, so calling keys on any Bundle instance would overwrite the result of a prior call on another instance.
Update the remove() test to assert it is a no-op for a non-existent key. Add a test verifying that keys from different Bundle instances are independent (no shared static list interference). Remove the now-unused flutter/services.dart import.
Add regression integration tests covering the public API of
tizen_bundle:Bundle(),Bundle.fromMap,Bundle.fromBundle,Bundle.decodeoperator[](get/set),remove(),clear()length,isEmpty,isNotEmpty,keysMapMixinmembers (containsKey,containsValue,entries,forEach,addAll,putIfAbsent)Validated on RPi4 and TV emulator.
#1039