@@ -23,48 +23,48 @@ void TestFormatMissingArgument()
23
23
// GOOD: All arguments supplied to params
24
24
String . Format ( "{0} {1} {2} {3}" , 0 , 1 , 2 , 3 ) ;
25
25
26
- helper ( "{1}" ) ; // $ Source
26
+ helper ( "{1}" ) ; // $ Source=source1
27
27
}
28
28
29
29
void helper ( string format )
30
30
{
31
31
// BAD: Missing {1}
32
- String . Format ( format , 0 ) ; // $ Alert Sink
32
+ String . Format ( format , 0 ) ; // $ Alert=source1 Sink=source1
33
33
}
34
34
35
35
void TestCompositeFormatMissingArgument ( )
36
36
{
37
37
var format0 = CompositeFormat . Parse ( "{0}" ) ;
38
- var format1 = CompositeFormat . Parse ( "{1}" ) ; // $ Source
38
+ var format1 = CompositeFormat . Parse ( "{1}" ) ; // $ Source=source2
39
39
var format01 = CompositeFormat . Parse ( "{0}{1}" ) ;
40
- var format23 = CompositeFormat . Parse ( "{2}{3}" ) ; // $ Source
40
+ var format23 = CompositeFormat . Parse ( "{2}{3}" ) ; // $ Source=source3
41
41
42
42
// GOOD: All args supplied
43
43
String . Format < string > ( null , format0 , "" ) ;
44
44
45
45
// BAD: Missing {1}
46
- String . Format < string > ( null , format1 , "" ) ; // $ Alert Sink
46
+ String . Format < string > ( null , format1 , "" ) ; // $ Alert=source2 Sink=source2
47
47
48
48
// GOOD: All args supplied
49
49
String . Format < string , string > ( null , format01 , "" , "" ) ;
50
50
51
51
// BAD: Missing {2} and {3}
52
- String . Format < string , string > ( null , format23 , "" , "" ) ; // $ Alert Sink
52
+ String . Format < string , string > ( null , format23 , "" , "" ) ; // $ Alert=source3 Sink=source3
53
53
54
54
55
55
// GOOD: All arguments supplied
56
56
sb . AppendFormat ( null , format0 , "" ) ;
57
57
sb . AppendFormat < string > ( null , format0 , "" ) ;
58
58
59
59
// BAD: Missing {1}
60
- sb . AppendFormat ( null , format1 , "" ) ; // $ Alert Sink
61
- sb . AppendFormat < string > ( null , format1 , "" ) ; // $ Alert Sink
60
+ sb . AppendFormat ( null , format1 , "" ) ; // $ Alert=source2 Sink=source2
61
+ sb . AppendFormat < string > ( null , format1 , "" ) ; // $ Alert=source2 Sink=source2
62
62
63
63
// GOOD: All args supplied
64
64
sb . AppendFormat < string , string > ( null , format01 , "" , "" ) ;
65
65
66
66
// BAD: Missing {2} and {3}
67
- sb . AppendFormat < string , string > ( null , format23 , "" , "" ) ; // $ Alert Sink
67
+ sb . AppendFormat < string , string > ( null , format23 , "" , "" ) ; // $ Alert=source3 Sink=source3
68
68
69
69
70
70
var span = new Span < char > ( ) ;
@@ -74,14 +74,14 @@ void TestCompositeFormatMissingArgument()
74
74
span . TryWrite < string > ( null , format0 , out _ , "" ) ;
75
75
76
76
// BAD: Missing {1}
77
- span . TryWrite ( null , format1 , out _ , "" ) ; // $ Alert Sink
78
- span . TryWrite < string > ( null , format1 , out _ , "" ) ; // $ Alert Sink
77
+ span . TryWrite ( null , format1 , out _ , "" ) ; // $ Alert=source2 Sink=source2
78
+ span . TryWrite < string > ( null , format1 , out _ , "" ) ; // $ Alert=source2 Sink=source2
79
79
80
80
// GOOD: All args supplied
81
81
span . TryWrite < string , string > ( null , format01 , out _ , "" , "" ) ;
82
82
83
83
// BAD: Missing {2} and {3}
84
- span . TryWrite < string , string > ( null , format23 , out _ , "" , "" ) ; // $ Alert Sink
84
+ span . TryWrite < string , string > ( null , format23 , out _ , "" , "" ) ; // $ Alert=source3 Sink=source3
85
85
}
86
86
87
87
object [ ] args ;
0 commit comments