21 lines
575 B
C#
21 lines
575 B
C#
|
using CanonSharp.Pascal.Parser;
|
|||
|
using CanonSharp.Pascal.SyntaxTree;
|
|||
|
using CanonSharp.Tests.Utils;
|
|||
|
|
|||
|
namespace CanonSharp.Tests.ParserTests;
|
|||
|
|
|||
|
public class VariableDeclarationTests : GrammarParserTestBase
|
|||
|
{
|
|||
|
[Theory]
|
|||
|
[InlineData("boolean", "boolean")]
|
|||
|
[InlineData("integer", "integer")]
|
|||
|
[InlineData("char", "char")]
|
|||
|
[InlineData("real", "real")]
|
|||
|
public void TypeParseTest(string input, string value)
|
|||
|
{
|
|||
|
TypeNode node = RunParser<TypeNode>(GrammarParser.TypeParser(), input);
|
|||
|
Assert.Equal(value, node.TypeToken.LiteralValue);
|
|||
|
}
|
|||
|
}
|
|||
|
|