Files
codeql/cpp/ql/test/TestUtilities/InlineExpectationsTest.qll
Rasmus Lerchedahl Petersen 8afb541718 cpp/swift: fix qldoc
2023-01-05 14:30:13 +01:00

36 lines
1.1 KiB
Plaintext

/**
* Inline expectation tests for C++.
* See `shared/util/codeql/util/test/InlineExpectationsTest.qll`
*/
import cpp as C
private import codeql.util.test.InlineExpectationsTest
private module Impl implements InlineExpectationsTestSig {
private newtype TExpectationComment = MkExpectationComment(C::CppStyleComment c)
/**
* A class representing a line comment in the CPP style.
* Unlike the `CppStyleComment` class, however, the string returned by `getContents` does _not_
* include the preceding comment marker (`//`).
*/
class ExpectationComment extends TExpectationComment {
C::CppStyleComment comment;
ExpectationComment() { this = MkExpectationComment(comment) }
/** Returns the contents of the given comment, _without_ the preceding comment marker (`//`). */
string getContents() { result = comment.getContents().suffix(2) }
/** Gets a textual representation of this element. */
string toString() { result = comment.toString() }
/** Gets the location of this comment. */
Location getLocation() { result = comment.getLocation() }
}
class Location = C::Location;
}
import Make<Impl>