diff --git a/w_common/lib/test_utils.dart b/w_common/lib/test_utils.dart deleted file mode 100644 index 93056281..00000000 --- a/w_common/lib/test_utils.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'dart:mirrors'; - -import 'package:w_common/disposable.dart'; - -/// A helper to assert that the `disposableTypeName` getter has been, -/// and remains, correctly overridden for a given [Disposable] subclass. -/// -/// Example usage might be to call this from a test: -/// -/// ``` -/// expect( -/// verifyDisposableTypeName(myObject, makeAssertion: false), -/// new Symbol('MyObject'), -/// ); -/// ``` -/// -/// By default, it will assert that the `disposableTypeName` matches the -/// simple class name. It will also return the [Symbol] that represents -/// the class name. -@Deprecated("Will be removed in 4.0.0") -Symbol verifyDisposableTypeName(Disposable object, - {bool makeAssertion = true}) { - final type = reflect(object).type.simpleName; - if (makeAssertion == true) { - assert(type == Symbol(object.disposableTypeName)); - } - return type; -} diff --git a/w_common/test/unit/vm/test_utils_test.dart b/w_common/test/unit/vm/test_utils_test.dart deleted file mode 100644 index ebe7dab4..00000000 --- a/w_common/test/unit/vm/test_utils_test.dart +++ /dev/null @@ -1,45 +0,0 @@ -@TestOn('vm') -import 'package:test/test.dart'; -import 'package:w_common/disposable.dart'; -import 'package:w_common/test_utils.dart'; - -void main() { - group('test_utils', () { - group('verifyDisposableTypeName', () { - test( - 'should throw AssertionError on name mismatch when makeAssertion == true', - () { - final c = MismatchClass(); - expect(() => verifyDisposableTypeName(c, makeAssertion: true), - throwsA(isA())); - }); - - test( - 'should not throw AssertionError on name mismatch when makeAssertion != true', - () { - final c = MismatchClass(); - expect(() => verifyDisposableTypeName(c, makeAssertion: false), - returnsNormally); - }); - - test('should always return name when names match', () { - final c = MatchClass(); - final name = verifyDisposableTypeName(c); - expect(name, Symbol('MatchClass')); - }); - - test('should always return name when makeAssertion = false', () { - final c = MismatchClass(); - final name = verifyDisposableTypeName(c, makeAssertion: false); - expect(name, Symbol('MismatchClass')); - }); - }); - }); -} - -class MatchClass extends Disposable { - @override - String get disposableTypeName => 'MatchClass'; -} - -class MismatchClass extends Disposable {} diff --git a/w_common_tools/CHANGELOG.md b/w_common_tools/CHANGELOG.md index d0e8b953..317c07c5 100644 --- a/w_common_tools/CHANGELOG.md +++ b/w_common_tools/CHANGELOG.md @@ -1,3 +1,48 @@ +## [4.0.0](https://github.com/Workiva/w_common/compare/3.6.0...4.0.0) + +- Potential BREAKING CHANGE: Removes deprecated `verifyDisposableTypeName`. +- PRs: [#214](https://github.com/Workiva/w_common/pull/214) + +## [3.6.0](https://github.com/Workiva/w_common/compare/3.5.0...3.6.0) + +- Deprecates `verifyDisposableTypeName`. +- PRs: [#215](https://github.com/Workiva/w_common/pull/215), [#216](https://github.com/Workiva/w_common/pull/216) + +## [3.5.0](https://github.com/Workiva/w_common/compare/3.4.0...3.5.0) + +- Allows latest dependency versions. +- PRs: [#212](https://github.com/Workiva/w_common/pull/212), [#213](https://github.com/Workiva/w_common/pull/213) + +## [3.4.0](https://github.com/Workiva/w_common/compare/3.3.0...3.4.0) + +- Adds internationalized date/time support and updates dependency constraints. +- PRs: [#201](https://github.com/Workiva/w_common/pull/201), [#202](https://github.com/Workiva/w_common/pull/202), [#205](https://github.com/Workiva/w_common/pull/205), [#208](https://github.com/Workiva/w_common/pull/208), [#210](https://github.com/Workiva/w_common/pull/210), [#211](https://github.com/Workiva/w_common/pull/211) + +## [3.3.0](https://github.com/Workiva/w_common/compare/3.2.0...3.3.0) + +- Raises dependency constraints and updates nullable management behavior. +- PRs: [#196](https://github.com/Workiva/w_common/pull/196), [#197](https://github.com/Workiva/w_common/pull/197), [#198](https://github.com/Workiva/w_common/pull/198), [#200](https://github.com/Workiva/w_common/pull/200) + +## [3.2.0](https://github.com/Workiva/w_common/compare/3.1.1...3.2.0) + +- Adds typedefs for JSON maps. +- PRs: [#194](https://github.com/Workiva/w_common/pull/194), [#195](https://github.com/Workiva/w_common/pull/195) + +## [3.1.1](https://github.com/Workiva/w_common/compare/3.1.0...3.1.1) + +- Patch release. +- PRs: [#192](https://github.com/Workiva/w_common/pull/192) + +## [3.1.0](https://github.com/Workiva/w_common/compare/3.0.1...3.1.0) + +- Updates SDK/tooling support and test/lint infrastructure. +- PRs: [#187](https://github.com/Workiva/w_common/pull/187), [#188](https://github.com/Workiva/w_common/pull/188), [#189](https://github.com/Workiva/w_common/pull/189), [#190](https://github.com/Workiva/w_common/pull/190), [#191](https://github.com/Workiva/w_common/pull/191) + +## [3.0.1](https://github.com/Workiva/w_common/compare/3.0.0...3.0.1) + +- Patch release for analyzer compatibility. +- PRs: [#184](https://github.com/Workiva/w_common/pull/184), [#185](https://github.com/Workiva/w_common/pull/185) + ## [3.0.0](https://github.com/Workiva/w_common/compare/2.1.2...3.0.0) - Migrate to null-safety.