Parser (unittests)

- Check for the single line
- Fixed comment
This commit is contained in:
Tristan B. Velloza Kildaire 2024-04-20 21:32:19 +02:00
parent df2e28da92
commit 992e96ce79
1 changed files with 8 additions and 1 deletions

View File

@ -3661,7 +3661,7 @@ unittest
}
/**
* If statement tests
* Comments tests
*/
unittest
{
@ -3711,6 +3711,13 @@ void function(int i, int p)
TypeChecker tc = new TypeChecker(compiler);
/* Find the variable named `p` and get its comment */
Entity varEnt = tc.getResolver().resolveBest(modulle, "p");
Variable var = cast(Variable)varEnt;
Comment varComment = var.getComment();
assert(varComment);
assert(varComment.getContent() == "Comment for Elise");
/* Find the function named `function` and get its comment */
Entity funcEnt = tc.getResolver().resolveBest(modulle, "function");
Function func = cast(Function)funcEnt;