File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
nextest-runner/src/config Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ pub enum TestGroup {
18
18
}
19
19
20
20
impl TestGroup {
21
+ /// The string `"@global"`, indicating the global test group.
22
+ pub const GLOBAL_STR : & ' static str = "@global" ;
23
+
21
24
pub ( crate ) fn make_all_groups (
22
25
custom_groups : impl IntoIterator < Item = CustomTestGroup > ,
23
26
) -> impl Iterator < Item = Self > {
@@ -36,7 +39,7 @@ impl<'de> Deserialize<'de> for TestGroup {
36
39
// Try and deserialize the group as a string. (Note: we don't deserialize a
37
40
// `CustomTestGroup` directly because that errors out on None.
38
41
let group = SmolStr :: deserialize ( deserializer) ?;
39
- if group == "@global" {
42
+ if group == Self :: GLOBAL_STR {
40
43
Ok ( TestGroup :: Global )
41
44
} else {
42
45
Ok ( TestGroup :: Custom (
@@ -50,7 +53,7 @@ impl FromStr for TestGroup {
50
53
type Err = InvalidCustomTestGroupName ;
51
54
52
55
fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
53
- if s == "@global" {
56
+ if s == Self :: GLOBAL_STR {
54
57
Ok ( TestGroup :: Global )
55
58
} else {
56
59
Ok ( TestGroup :: Custom ( CustomTestGroup :: new ( s. into ( ) ) ?) )
You can’t perform that action at this time.
0 commit comments