From bc9fa6ba131fab239bffeaefec6d374664fd10bb Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Mon, 15 Jun 2026 21:06:03 +0100 Subject: [PATCH] Fix bug in inline expectations test implementation This was stopping trailing comments, as in `// $ Alert // some comment`, from working. --- swift/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll b/swift/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll index af84a908633..b96f27c42ac 100644 --- a/swift/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll +++ b/swift/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll @@ -15,7 +15,7 @@ module Impl implements InlineExpectationsTestSig { ExpectationComment() { this = MkExpectationComment(comment) } /** Returns the contents of the given comment, _without_ the preceding comment marker (`//`). */ - string getContents() { result = comment.getText().suffix(2) } + string getContents() { result = comment.getText().suffix(2).trim() } /** Gets a textual representation of this element. */ string toString() { result = comment.toString() }