1+ class C
2+ {
3+ void Problems ( )
4+ {
5+ // correct expectation comment, but only for `problem-query`
6+ var x = "Alert" ; // $ Alert
7+
8+ // irrelevant expectation comment, will be ignored
9+ x = "Not an alert" ; // $ IrrelevantTag
10+
11+ // incorrect expectation comment
12+ x = "Also not an alert" ; // $ Alert
13+
14+ // missing expectation comment, but only for `problem-query`
15+ x = "Alert" ;
16+
17+ // correct expectation comment
18+ x = "Alert" ; // $ Alert[problem-query]
19+ }
20+
21+ void PathProblems ( )
22+ {
23+ // correct expectation comments, but only for `path-problem-query`
24+ var source = "Source" ; // $ Source
25+ var sink = "Sink" ; // $ Sink
26+ var x = "Alert:2:1" ; // $ Alert
27+
28+ // incorrect expectation comments
29+ source = "Source" ; // $ Source
30+ sink = "Sink" ; // $ Sink
31+ x = "Not an alert:2:1" ; // $ Alert
32+
33+ // missing expectation comments, but only for `path-problem-query`
34+ source = "Source" ;
35+ sink = "Sink" ;
36+ x = "Alert:2:1" ;
37+
38+ // correct expectation comments
39+ source = "Source" ; // $ Source[path-problem-query]
40+ sink = "Sink" ; // $ Sink[path-problem-query]
41+ x = "Alert:2:1" ; // $ Alert[path-problem-query]
42+
43+ // correct expectation comments; the alert location coincides with the sink location
44+ source = "Source" ; // $ Source[path-problem-query]
45+ x = "Alert:1:0" ; // $ Alert[path-problem-query]
46+
47+ // correct expectation comments; the alert location coincides with the source location
48+ sink = "Sink" ; // $ Sink[path-problem-query]
49+ x = "Alert:0:1" ; // $ Alert[path-problem-query]
50+
51+ // correct expectation comments, using an identifier tag
52+ source = "Source" ; // $ Source[path-problem-query]=source1
53+ sink = "Sink" ; // $ Sink[path-problem-query]=source1
54+ x = "Alert:2:1" ; // $ Alert[path-problem-query]=source1
55+
56+ // incorrect expectation comment, using wrong identifier tag at the sink
57+ source = "Source" ; // $ Source[path-problem-query]=source2
58+ sink = "Sink" ; // $ Sink[path-problem-query]=source1
59+ x = "Alert:2:1" ; // $ Alert[path-problem-query]=source2
60+
61+ // incorrect expectation comment, using wrong identifier tag at the alert
62+ source = "Source" ; // $ Source[path-problem-query]=source3
63+ sink = "Sink" ; // $ Sink[path-problem-query]=source3
64+ x = "Alert:2:1" ; // $ Alert[path-problem-query]=source2
65+
66+ // correct expectation comments, using an identifier tag; the alert location coincides with the sink location
67+ source = "Source" ; // $ Source[path-problem-query]=source4
68+ x = "Alert:1:0" ; // $ Alert[path-problem-query]=source4
69+
70+ // incorrect expectation comments, using an identifier tag; the alert location coincides with the sink location
71+ source = "Source" ; // $ Source[path-problem-query]=source5
72+ x = "Alert:1:0" ; // $ Alert[path-problem-query]=source4
73+
74+ // correct expectation comments, using an identifier tag; the alert location coincides with the source location
75+ sink = "Sink" ; // $ Sink[path-problem-query]=sink1
76+ x = "Alert:0:1" ; // $ Alert[path-problem-query]=sink1
77+
78+ // incorrect expectation comments, using an identifier tag; the alert location coincides with the source location
79+ sink = "Sink" ; // $ Sink[path-problem-query]=sink2
80+ x = "Alert:0:1" ; // $ Alert[path-problem-query]=sink1
81+ }
82+ }
0 commit comments