getAssertIndex

Undocumented in source. Be warned that the author may not have intended to support it.
@safe
size_t
getAssertIndex
(
const(Token)[] tokens
,
size_t startLine
)

Examples

Get the index of the Assert structure identifier from a list of tokens

const(Token)[] tokens = [];
splitMultilinetokens(fileToDTokens("test/values.d"), tokens);

auto result = getAssertIndex(tokens, 55);

tokens[result .. result + 4].toString.strip.should.equal(`Assert.equal(`);

Meta