Skip to content

Commit 71a6b09

Browse files
committed
Minor syntax change in tests
1 parent 8fb5c37 commit 71a6b09

File tree

1 file changed

+4
-4
lines changed
  • java/ql/test/library-tests/pathsanitizer

1 file changed

+4
-4
lines changed

java/ql/test/library-tests/pathsanitizer/TestKt.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class TestKt {
9595
// PathTraversalSanitizer + allowListGuard
9696
run {
9797
val source: File? = source() as File?
98-
val normalized: String = source!!.getCanonicalPath()
98+
val normalized: String = source!!.canonicalPath
9999
if (normalized.startsWith("/safe")) {
100100
sink(source) // Safe
101101
sink(normalized) // Safe
@@ -106,7 +106,7 @@ class TestKt {
106106
}
107107
run {
108108
val source: File? = source() as File?
109-
val normalized: String = source!!.getCanonicalFile().toString()
109+
val normalized: File = source!!.canonicalFile.toString()
110110
if (normalized.startsWith("/safe")) {
111111
sink(source) // Safe
112112
sink(normalized) // Safe
@@ -328,7 +328,7 @@ class TestKt {
328328
// PathTraversalSanitizer + blockListGuard
329329
run {
330330
val source: File? = source() as File?
331-
val normalized: String = source!!.getCanonicalPath()
331+
val normalized: String = source!!.canonicalPath
332332
if (!normalized.startsWith("/data")) {
333333
sink(source) // Safe
334334
sink(normalized) // Safe
@@ -339,7 +339,7 @@ class TestKt {
339339
}
340340
run {
341341
val source: File? = source() as File?
342-
val normalized: String = source!!.getCanonicalFile().toString()
342+
val normalized: String = source!!.canonicalFile.toString()
343343
if (!normalized.startsWith("/data")) {
344344
sink(source) // Safe
345345
sink(normalized) // Safe

0 commit comments

Comments
 (0)