Convert test to inline expectations

This commit is contained in:
Owen Mansel-Chan
2025-03-25 11:36:37 +00:00
parent ff2947a0e5
commit b5b252b10f
2 changed files with 4 additions and 3 deletions

View File

@@ -1 +1,2 @@
Performance/StringReplaceAllWithNonRegex.ql
query: Performance/StringReplaceAllWithNonRegex.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1,7 +1,7 @@
public class Test {
void f() {
String s1 = "test";
s1 = s1.replaceAll("t", "x"); // NON_COMPLIANT
s1 = s1.replaceAll(".*", "x"); // COMPLIANT
s1 = s1.replaceAll("t", "x"); // $ Alert
s1 = s1.replaceAll(".*", "x");
}
}