単体テストを追加
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
<useArrayBounds>0</useArrayBounds>
|
<useArrayBounds>0</useArrayBounds>
|
||||||
<noboundscheck>0</noboundscheck>
|
<noboundscheck>0</noboundscheck>
|
||||||
<useSwitchError>0</useSwitchError>
|
<useSwitchError>0</useSwitchError>
|
||||||
<useUnitTests>0</useUnitTests>
|
<useUnitTests>1</useUnitTests>
|
||||||
<useInline>0</useInline>
|
<useInline>0</useInline>
|
||||||
<release>0</release>
|
<release>0</release>
|
||||||
<preservePaths>0</preservePaths>
|
<preservePaths>0</preservePaths>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<pic>0</pic>
|
<pic>0</pic>
|
||||||
<cov>0</cov>
|
<cov>0</cov>
|
||||||
<nofloat>0</nofloat>
|
<nofloat>0</nofloat>
|
||||||
<Dversion>2.043</Dversion>
|
<Dversion>2</Dversion>
|
||||||
<ignoreUnsupportedPragmas>0</ignoreUnsupportedPragmas>
|
<ignoreUnsupportedPragmas>0</ignoreUnsupportedPragmas>
|
||||||
<allinst>0</allinst>
|
<allinst>0</allinst>
|
||||||
<stackStomp>0</stackStomp>
|
<stackStomp>0</stackStomp>
|
||||||
@@ -205,13 +205,10 @@
|
|||||||
<filesToClean>*.obj;*.cmd;*.build;*.json;*.dep</filesToClean>
|
<filesToClean>*.obj;*.cmd;*.build;*.json;*.dep</filesToClean>
|
||||||
</Config>
|
</Config>
|
||||||
<Folder name="SMILEBASIC">
|
<Folder name="SMILEBASIC">
|
||||||
<Folder name="otya">
|
|
||||||
<Folder name="smilebasic" />
|
|
||||||
<File path="node.d" />
|
|
||||||
<File path="parser.d" />
|
|
||||||
<File path="token.d" />
|
|
||||||
<File path="type.d" />
|
|
||||||
</Folder>
|
|
||||||
<File path="main.d" />
|
<File path="main.d" />
|
||||||
|
<File path="node.d" />
|
||||||
|
<File path="parser.d" />
|
||||||
|
<File path="token.d" />
|
||||||
|
<File path="type.d" />
|
||||||
</Folder>
|
</Folder>
|
||||||
</DProject>
|
</DProject>
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ import std.stdio;
|
|||||||
int main(string[] argv)
|
int main(string[] argv)
|
||||||
{
|
{
|
||||||
writeln("Hello D-World!");
|
writeln("Hello D-World!");
|
||||||
|
readln();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,22 @@ class Lexical
|
|||||||
}
|
}
|
||||||
unittest
|
unittest
|
||||||
{
|
{
|
||||||
auto lex = new Lexical("1");
|
{
|
||||||
|
auto lex = new Lexical("1");
|
||||||
|
assert(lex.empty() == false);
|
||||||
|
lex.popFront();
|
||||||
|
auto token = lex.front();
|
||||||
|
assert(token.type == TokenType.Integer);
|
||||||
|
assert(token.value.integerValue == 1);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
auto lex = new Lexical("12345");
|
||||||
|
assert(lex.empty() == false);
|
||||||
|
lex.popFront();
|
||||||
|
auto token = lex.front();
|
||||||
|
assert(token.type == TokenType.Integer);
|
||||||
|
assert(token.value.integerValue == 12345);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
class Parser
|
class Parser
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user