File tree Expand file tree Collapse file tree 2 files changed +34
-34
lines changed
utils/modelgenerator/typebasedflow Expand file tree Collapse file tree 2 files changed +34
-34
lines changed Original file line number Diff line number Diff line change
1
+ signature module InlineMadTestConfigSig {
2
+ /**
3
+ * Gets a relevant code comment, if any.
4
+ */
5
+ string getComment ( ) ;
6
+
7
+ /**
8
+ * Gets an identified summary, if any.
9
+ */
10
+ string getCapturedSummary ( ) ;
11
+ }
12
+
13
+ module InlineMadTest< InlineMadTestConfigSig Input> {
14
+ private string expects ( ) {
15
+ Input:: getComment ( ) .regexpCapture ( " *(SPURIOUS-)?MaD=(.*)" , 2 ) = result
16
+ }
17
+
18
+ query predicate unexpectedSummary ( string msg ) {
19
+ exists ( string flow |
20
+ flow = Input:: getCapturedSummary ( ) and
21
+ not flow = expects ( ) and
22
+ msg = "Unexpected summary found: " + flow
23
+ )
24
+ }
25
+
26
+ query predicate expectedSummary ( string msg ) {
27
+ exists ( string e |
28
+ e = expects ( ) and
29
+ not e = Input:: getCapturedSummary ( ) and
30
+ msg = "Expected summary missing: " + e
31
+ )
32
+ }
33
+ }
Original file line number Diff line number Diff line change 1
1
import java
2
+ import TestUtilities.InlineMadTest
2
3
import utils.modelgenerator.internal.CaptureTypeBasedSummaryModels
3
4
4
- signature module InlineMadTestConfigSig {
5
- /**
6
- * Gets a relevant code comment, if any.
7
- */
8
- string getComment ( ) ;
9
-
10
- /**
11
- * Gets an identified summary, if any.
12
- */
13
- string getCapturedSummary ( ) ;
14
- }
15
-
16
- module InlineMadTest< InlineMadTestConfigSig Input> {
17
- private string expects ( ) {
18
- Input:: getComment ( ) .regexpCapture ( " *(SPURIOUS-)?MaD=(.*)" , 2 ) = result
19
- }
20
-
21
- query predicate unexpectedSummary ( string msg ) {
22
- exists ( string flow |
23
- flow = Input:: getCapturedSummary ( ) and
24
- not flow = expects ( ) and
25
- msg = "Unexpected summary found: " + flow
26
- )
27
- }
28
-
29
- query predicate expectedSummary ( string msg ) {
30
- exists ( string e |
31
- e = expects ( ) and
32
- not e = Input:: getCapturedSummary ( ) and
33
- msg = "Expected summary missing: " + e
34
- )
35
- }
36
- }
37
-
38
5
module InlineMadTestConfig implements InlineMadTestConfigSig {
39
6
string getComment ( ) { result = any ( Javadoc doc ) .getChild ( 0 ) .toString ( ) }
40
7
You can’t perform that action at this time.
0 commit comments