Skip to content

Commit

Permalink
Parser (unittests)
Browse files Browse the repository at this point in the history
- Check for the single line
- Fixed comment
  • Loading branch information
deavmi committed Apr 20, 2024
1 parent df2e28d commit 992e96c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/tlang/compiler/parsing/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -3661,7 +3661,7 @@ unittest
}

/**
* If statement tests
* Comments tests
*/
unittest
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 992e96c

Please sign in to comment.