1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

test AssertStatement

This commit is contained in:
Ayman Nadeem 2018-07-23 17:42:37 -04:00
parent 5aabbddb8f
commit 6237546e10
6 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,7 @@
class Dino {
void fn() {
for (File file : snap.index()) {
assert oldFile == null;
}
}
}

View File

@ -0,0 +1,5 @@
class Dino {
void fn() {
assert failure : "expecting non null";
}
}

View File

@ -0,0 +1,25 @@
(Statements
(Class
(Identifier)
(Statements
(Method
(Void)
(Empty)
(Identifier)
(Statements
{+(AssertStatement
{+(Identifier)+}
{+(TextElement)+})+}
{-(ForEach
{-(Variable
{-(Identifier)-}
{-(Identifier)-})-}
{-(Call
{-(MemberAccess
{-(Identifier)-})-}
{-(Empty)-})-}
{-(Statements
{-(AssertStatement
{-(Equal
{-(Identifier)-}
{-(Null)-})-})-})-})-})))))

View File

@ -0,0 +1,25 @@
(Statements
(Class
(Identifier)
(Statements
(Method
(Void)
(Empty)
(Identifier)
(Statements
{+(ForEach
{+(Variable
{+(Identifier)+}
{+(Identifier)+})+}
{+(Call
{+(MemberAccess
{+(Identifier)+})+}
{+(Empty)+})+}
{+(Statements
{+(AssertStatement
{+(Equal
{+(Identifier)+}
{+(Null)+})+})+})+})+}
{-(AssertStatement
{-(Identifier)-}
{-(TextElement)-})-})))))

View File

@ -0,0 +1,22 @@
(Statements
(Class
(Identifier)
(Statements
(Method
(Void)
(Empty)
(Identifier)
(Statements
(ForEach
(Variable
(Identifier)
(Identifier))
(Call
(MemberAccess
(Identifier))
(Empty))
(Statements
(AssertStatement
(Equal
(Identifier)
(Null))))))))))

View File

@ -0,0 +1,12 @@
(Statements
(Class
(Identifier)
(Statements
(Method
(Void)
(Empty)
(Identifier)
(Statements
(AssertStatement
(Identifier)
(TextElement)))))))