From af4fe7daf8e94a46981e4f072872be550a6969e9 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Wed, 11 Mar 2020 10:14:56 -0700 Subject: [PATCH] Deprecate the mirror matchers library (#131) I cannot find usage. Asserting that an object has a property with a known name can be accomplished by casting to `dynamic` and attempting to read from that property. Asserting that an object has a property with a name that is unknown at compile time has no known use case, if it comes up it would re rare enough that the code for using mirrors to solve it can be put into the test. --- CHANGELOG.md | 3 ++- lib/mirror_matchers.dart | 3 +++ pubspec.yaml | 2 +- test/mirror_matchers_test.dart | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0cbf07726bbe..2d4253971f076 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ -## 0.12.7-dev +## 0.12.7 +- Deprecate the `mirror_matchers.dart` library. - Update minimum Dart SDK to `2.4.0`. ## 0.12.6 diff --git a/lib/mirror_matchers.dart b/lib/mirror_matchers.dart index 8a7a95ed2faf0..72b20969909cf 100644 --- a/lib/mirror_matchers.dart +++ b/lib/mirror_matchers.dart @@ -2,6 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +@deprecated +library mirror_matchers; + /// The mirror matchers library provides some additional matchers that /// make use of `dart:mirrors`. import 'dart:mirrors'; diff --git a/pubspec.yaml b/pubspec.yaml index f4f951c39ae26..d472547ba5b31 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: matcher -version: 0.12.7-dev +version: 0.12.7 description: >- Support for specifying test expectations via an extensible Matcher class. diff --git a/test/mirror_matchers_test.dart b/test/mirror_matchers_test.dart index c88e1684b9af4..beff992e793fc 100644 --- a/test/mirror_matchers_test.dart +++ b/test/mirror_matchers_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// ignore_for_file: deprecated_member_use_from_same_package + @TestOn('vm') import 'package:matcher/mirror_matchers.dart';