diff --git a/lib/src/utils/type_utils.dart b/lib/src/utils/type_utils.dart index 46d0cd5..8dc400b 100644 --- a/lib/src/utils/type_utils.dart +++ b/lib/src/utils/type_utils.dart @@ -1,9 +1,9 @@ /// Utilities for working with Dart type system. class TypeUtils { /// Check two types for equality. - /// + /// /// Returns `true` if types match exactly, taking nullable types into account. - /// + /// /// Example outputs: /// ``` /// TypeUtils.areTypesEqual() == true diff --git a/test/hydrated_behavior_test.dart b/test/hydrated_behavior_test.dart index 9d7b99f..ac94b43 100644 --- a/test/hydrated_behavior_test.dart +++ b/test/hydrated_behavior_test.dart @@ -497,8 +497,8 @@ void main() { }); test('can be listened to multiple times', () async { - final subject = - HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + final subject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); final stream = subject.stream; await expectLater(stream, emits(1)); @@ -530,8 +530,8 @@ void main() { }); test('setter `value=` has same behavior as adding to Subject', () async { - final subject = - HydratedSubject('key', seedValue: 0, keyValueStore: mockKeyValueStore); + final subject = HydratedSubject('key', + seedValue: 0, keyValueStore: mockKeyValueStore); subject.value = 1; @@ -726,7 +726,8 @@ void main() { group('override built-in', () { test('where', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject.where((event) => event.isOdd); expect(stream, emitsInOrder([1, 3])); @@ -750,7 +751,8 @@ void main() { test('map', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var mapped = hydratedSubject.map((event) => event + 1); expect(mapped, emitsInOrder([2, 3])); @@ -772,7 +774,8 @@ void main() { test('asyncMap', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var mapped = hydratedSubject.asyncMap((event) => Future.value(event + 1)); @@ -796,7 +799,8 @@ void main() { test('asyncExpand', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject.asyncExpand((event) => Stream.value(event + 1)); @@ -820,7 +824,8 @@ void main() { test('handleError', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject.handleError( expectAsync1( @@ -862,7 +867,8 @@ void main() { test('expand', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject.expand((event) => [event + 1]); expect(stream, emitsInOrder([2, 3])); @@ -884,7 +890,8 @@ void main() { test('transform', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject.transform( IntervalStreamTransformer(const Duration(milliseconds: 100))); @@ -931,7 +938,8 @@ void main() { test('take', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject.take(2); expect(stream, emitsInOrder([1, 2])); @@ -955,7 +963,8 @@ void main() { test('takeWhile', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject.takeWhile((element) => element <= 2); expect(stream, emitsInOrder([1, 2])); @@ -979,7 +988,8 @@ void main() { test('skip', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject.skip(2); expect(stream, emitsInOrder([3, 4])); @@ -1005,7 +1015,8 @@ void main() { test('skipWhile', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject.skipWhile((element) => element < 3); expect(stream, emitsInOrder([3, 4])); @@ -1031,7 +1042,8 @@ void main() { test('distinct', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject.distinct(); expect(stream, emitsInOrder([1, 2])); @@ -1057,7 +1069,8 @@ void main() { test('timeout', () { { - var hydratedSubject = HydratedSubject('key', seedValue: 1, keyValueStore: mockKeyValueStore); + var hydratedSubject = HydratedSubject('key', + seedValue: 1, keyValueStore: mockKeyValueStore); var stream = hydratedSubject .interval(const Duration(milliseconds: 100)) diff --git a/test/hydrated_test.dart b/test/hydrated_test.dart index eb89354..8577da1 100644 --- a/test/hydrated_test.dart +++ b/test/hydrated_test.dart @@ -114,7 +114,8 @@ void main() { }); test('exposes the persistence key', () { - final subject = HydratedSubject(key, keyValueStore: mockKeyValueStore); + final subject = + HydratedSubject(key, keyValueStore: mockKeyValueStore); expect(subject.key, key); }); @@ -125,7 +126,8 @@ void main() { mockKeyValueStore.putOverride = expectAsync2((key, value) async { expect(value, equals(testValue)); }, count: 1); - final subject = HydratedSubject(key, keyValueStore: mockKeyValueStore); + final subject = + HydratedSubject(key, keyValueStore: mockKeyValueStore); subject.add(testValue); }); @@ -159,8 +161,7 @@ void main() { test( 'given persistence interface `get` throws a StoreError, ' 'it emits the error through the stream', () { - mockKeyValueStore.getOverride = - (_) async => throw StoreError('test'); + mockKeyValueStore.getOverride = (_) async => throw StoreError('test'); final subject = HydratedSubject(key, keyValueStore: mockKeyValueStore); @@ -192,8 +193,7 @@ void main() { 'given persistence interface put throws a StoreError, ' 'it emits the error through the stream', () async { const testValue = 42; - mockKeyValueStore.putOverride = - (_, __) => throw StoreError('test'); + mockKeyValueStore.putOverride = (_, __) => throw StoreError('test'); final subject = HydratedSubject(key, keyValueStore: mockKeyValueStore);