File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/BenchmarkDotNet/Running Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -51,14 +51,22 @@ public Descriptor(
51
51
IterationCleanupMethod = iterationCleanupMethod ;
52
52
OperationsPerInvoke = operationsPerInvoke ;
53
53
AdditionalLogic = additionalLogic ?? string . Empty ;
54
- WorkloadMethodDisplayInfo = description ?? workloadMethod ? . Name ?? "Untitled" ;
54
+ WorkloadMethodDisplayInfo = FormatDescription ( description ) ?? workloadMethod ? . Name ?? "Untitled" ;
55
55
Baseline = baseline ;
56
56
Categories = categories ?? Array . Empty < string > ( ) ;
57
57
MethodIndex = methodIndex ;
58
58
}
59
59
60
60
public override string ToString ( ) => DisplayInfo ;
61
61
62
+ private static string FormatDescription ( [ CanBeNull ] string description )
63
+ {
64
+ var specialSymbols = new [ ] { ' ' , '\' ' , '[' , ']' } ;
65
+ return description != null && specialSymbols . Any ( description . Contains )
66
+ ? "'" + description + "'"
67
+ : description ;
68
+ }
69
+
62
70
public bool HasCategory ( string category ) => Categories . Any ( c => c . EqualsWithIgnoreCase ( category ) ) ;
63
71
64
72
public string GetFilterName ( ) => $ "{ Type . GetCorrectCSharpTypeName ( includeGenericArgumentsNamespace : false ) } .{ WorkloadMethod . Name } ";
You can’t perform that action at this time.
0 commit comments