Parser (unittests)

- Removed unuueded unittests
This commit is contained in:
Tristan B. Velloza Kildaire 2024-04-20 21:34:01 +02:00
parent 992e96ce79
commit 52f7e3a5ab
1 changed files with 0 additions and 90 deletions

View File

@ -3758,94 +3758,4 @@ void function(int i, int p)
{
assert(false);
}
}
/**
* Tests the handling of comments
*/
unittest
{
import tlang.compiler.lexer.kinds.arr : ArrLexer;
try
{
string sourceCode = `module myCommentModule;
// Hello`;
File dummyFile;
Compiler compiler = new Compiler(sourceCode, "legitidk.t", dummyFile);
compiler.doLex();
compiler.doParse();
// FIXME: Re-enable when we we have
// a way to extract comments from
// AST nodes
// assert(parser.hasCommentsOnStack());
// assert(parser.getCommentCount() == 1);
}
catch(TError e)
{
assert(false);
}
try
{
string sourceCode = `module myCommntedModule;
/*Hello */
/* Hello*/`;
File dummyFile;
Compiler compiler = new Compiler(sourceCode, "legitidk.t", dummyFile);
compiler.doLex();
compiler.doParse();
// FIXME: Re-enable when we we have
// a way to extract comments from
// AST nodes
// assert(parser.hasCommentsOnStack());
// assert(parser.getCommentCount() == 1);
}
catch(TError e)
{
assert(false);
}
try
{
string sourceCode = `module myCommentedModule;
void function()
{
/*Hello */
/* Hello */
// Hello
//Hello
}
`;
File dummyFile;
Compiler compiler = new Compiler(sourceCode, "legitidk.t", dummyFile);
compiler.doLex();
compiler.doParse();
// FIXME: Re-enable when we we have
// a way to extract comments from
// AST nodes
// assert(parser.hasCommentsOnStack());
// assert(parser.getCommentCount() == 1);
// assert(parser.hasCommentsOnStack());
// assert(parser.getCommentCount() == 4);
}
catch(TError e)
{
assert(false);
}
}