From f64ba0cadd48fbb9eb15664fd4bb5f02ffb119d3 Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Thu, 3 May 2018 04:39:04 +0000 Subject: [PATCH] Add @isTest and @isTestGroup to package:meta R=devoncarew@google.com, paulberry@google.com Bug: https://github.com/flutter/flutter-intellij/issues/2055 Change-Id: I78083783a3e05171746253101b3b10bbdcc8ef99 Reviewed-on: https://dart-review.googlesource.com/53480 Reviewed-by: Paul Berry Reviewed-by: Devon Carew Commit-Queue: Konstantin Shcheglov --- pkg/meta/lib/meta.dart | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pkg/meta/lib/meta.dart b/pkg/meta/lib/meta.dart index 3e8395e9920..ea23c35ec54 100644 --- a/pkg/meta/lib/meta.dart +++ b/pkg/meta/lib/meta.dart @@ -105,6 +105,22 @@ const _Factory factory = const _Factory(); /// class that has this annotation is not immutable. const Immutable immutable = const Immutable(); +/// Used to annotate a test framework function that runs a single test. +/// +/// Tools, such as IDEs, can show invocations of such function in a file +/// structure view to help the user navigating in large test files. +/// +/// The first parameter of the function must be the description of the test. +const _IsTest isTest = const _IsTest(); + +/// Used to annotate a test framework function that runs a group of tests. +/// +/// Tools, such as IDEs, can show invocations of such function in a file +/// structure view to help the user navigating in large test files. +/// +/// The first parameter of the function must be the description of the group. +const _IsTestGroup isTestGroup = const _IsTestGroup(); + /// Used to annotate a const constructor `c`. Indicates that any invocation of /// the constructor must use the keyword `const` unless one or more of the /// arguments to the constructor is not a compile-time constant. @@ -244,6 +260,14 @@ class _Factory { const _Factory(); } +class _IsTest { + const _IsTest(); +} + +class _IsTestGroup { + const _IsTestGroup(); +} + class _Literal { const _Literal(); }