This repository was archived by the owner on Jan 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,5 +115,5 @@ where
115115 becomesPartOf * ( base , init )
116116 ) and
117117 // exclude results in test code
118- exists ( File fl | fl = w .getFile ( ) | not fl = any ( TestCase tc ) . getFile ( ) )
118+ exists ( File fl | fl = w .getFile ( ) | not fl instanceof TestFile )
119119select w , "InsecureSkipVerify should not be used in production code."
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ string generatorCommentRegex() {
2121
2222predicate classify ( File f , string category ) {
2323 // tests
24- f = any ( TestCase tc ) . getFile ( ) and
24+ f instanceof TestFile and
2525 category = "test"
2626 or
2727 // vendored code
Original file line number Diff line number Diff line change @@ -40,3 +40,31 @@ module TestCase {
4040 }
4141 }
4242}
43+
44+ /**
45+ * A file that contains test cases or is otherwise used for testing.
46+ *
47+ * Extend this class to refine existing models of testing frameworks. If you want to model new
48+ * frameworks, extend `TestFile::Range` instead.
49+ */
50+ class TestFile extends File {
51+ TestFile:: Range self ;
52+
53+ TestFile ( ) { this = self }
54+ }
55+
56+ /** Provides classes for working with test files. */
57+ module TestFile {
58+ /**
59+ * A file that contains test cases or is otherwise used for testing.
60+ *
61+ * Extend this class to model new testing frameworks. If you want to refine existing models,
62+ * extend `TestFile` instead.
63+ */
64+ abstract class Range extends File { }
65+
66+ /** A file containing at least one test case. */
67+ private class FileContainingTestCases extends Range {
68+ FileContainingTestCases ( ) { this = any ( TestCase tc ) .getFile ( ) }
69+ }
70+ }
You can’t perform that action at this time.
0 commit comments