Skip to content

Commit f6a0231

Browse files
committed
C#: Fix bad join order in TestLibrary characteristic predicate.
1 parent 02364d0 commit f6a0231

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

csharp/ql/src/Telemetry/ExternalApi.qll

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@ private import semmle.code.csharp.dataflow.internal.DataFlowDispatch as DataFlow
1111
private import semmle.code.csharp.dataflow.internal.TaintTrackingPrivate
1212
private import semmle.code.csharp.security.dataflow.flowsources.Remote
1313

14+
pragma[nomagic]
15+
private predicate isTestNamespace(Namespace ns) {
16+
ns.getFullName()
17+
.matches([
18+
"NUnit.Framework%", "Xunit%", "Microsoft.VisualStudio.TestTools.UnitTesting%", "Moq%"
19+
])
20+
}
21+
1422
/**
1523
* A test library.
1624
*/
1725
class TestLibrary extends RefType {
18-
TestLibrary() {
19-
this.getNamespace()
20-
.getFullName()
21-
.matches([
22-
"NUnit.Framework%", "Xunit%", "Microsoft.VisualStudio.TestTools.UnitTesting%", "Moq%"
23-
])
24-
}
26+
TestLibrary() { isTestNamespace(this.getNamespace()) }
2527
}
2628

2729
/** Holds if the given callable is not worth supporting. */

0 commit comments

Comments
 (0)