We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37e9f09 commit fc69fe5Copy full SHA for fc69fe5
test/shared/tests/storage_key_test.dart
@@ -0,0 +1,26 @@
1
+import 'package:grumpy/grumpy.dart';
2
+import 'package:test/test.dart';
3
+
4
+void main() {
5
+ group('StorageKey', () {
6
+ test('.asStorageKey() is reversible', () {
7
+ final key = const StorageKey(
8
+ namespace: 'test',
9
+ primaryKey: 'asStorageKey()',
10
+ schemaId: 'reversible',
11
+ );
12
13
+ final storageKey = key.asStorageKey();
14
+ final reversedKey = StorageKey.parse(storageKey);
15
+ expect(reversedKey, key);
16
+ expect(storageKey, key.asStorageKey());
17
+ });
18
19
+ test('parse throws on invalid format', () {
20
+ expect(
21
+ () => StorageKey.parse('invalid-format'),
22
+ throwsA(isA<FormatException>()),
23
24
25
26
+}
0 commit comments