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

Update select statements tests

This commit is contained in:
Rick Winfrey 2017-11-15 10:10:14 -08:00
parent 0d55fcb378
commit 2453d66af1
6 changed files with 137 additions and 27 deletions

View File

@ -8,6 +8,11 @@ select {
println(5)
case <-time.After(1):
println(6)
n--
if x {
waitDone <- result{n, x}
return
}
default:
return
}

View File

@ -8,6 +8,11 @@ select {
println(5)
case <-time.After(2):
println(6)
n++
if v {
waitDone <- result{n, v}
return
}
default:
return
}

View File

@ -40,10 +40,43 @@
{ (Integer)
->(Integer) }
(Empty))))
(Call
(Identifier)
(Integer)
(Empty)))
(
(Call
(Identifier)
(Integer)
(Empty))
{+(PostIncrement
{+(Identifier)+})+}
{+(If
{+(
{+(Identifier)+})+}
{+(
{+(Send
{+(Identifier)+}
{+(Composite
{+(Identifier)+}
{+(
{+(Identifier)+}
{+(Identifier)+})+})+})+}
{+(Return
{+(Empty)+})+})+}
{+(Empty)+})+}
{-(PostDecrement
{-(Identifier)-})-}
{-(If
{-(
{-(Identifier)-})-}
{-(
{-(Send
{-(Identifier)-}
{-(Composite
{-(Identifier)-}
{-(
{-(Identifier)-}
{-(Identifier)-})-})-})-}
{-(Return
{-(Empty)-})-})-}
{-(Empty)-})-}))
(Pattern
(DefaultPattern
([]))
@ -58,15 +91,15 @@
(Empty)
{ (Identifier)
->(Identifier) }))
(Empty))
([]))
(Pattern
(Receive
(Empty)
(Receive
(Empty)
(Identifier)))
(Empty))
([]))
{-(Pattern
{-(DefaultPattern
{-([])-})-}
{-(Empty)-})-})))))
{-([])-})-})))))

View File

@ -40,10 +40,43 @@
{ (Integer)
->(Integer) }
(Empty))))
(Call
(Identifier)
(Integer)
(Empty)))
(
(Call
(Identifier)
(Integer)
(Empty))
{+(PostDecrement
{+(Identifier)+})+}
{+(If
{+(
{+(Identifier)+})+}
{+(
{+(Send
{+(Identifier)+}
{+(Composite
{+(Identifier)+}
{+(
{+(Identifier)+}
{+(Identifier)+})+})+})+}
{+(Return
{+(Empty)+})+})+}
{+(Empty)+})+}
{-(PostIncrement
{-(Identifier)-})-}
{-(If
{-(
{-(Identifier)-})-}
{-(
{-(Send
{-(Identifier)-}
{-(Composite
{-(Identifier)-}
{-(
{-(Identifier)-}
{-(Identifier)-})-})-})-}
{-(Return
{-(Empty)-})-})-}
{-(Empty)-})-}))
(Pattern
(DefaultPattern
([]))
@ -58,15 +91,15 @@
(Empty)
{ (Identifier)
->(Identifier) }))
(Empty))
([]))
(Pattern
(Receive
(Empty)
(Receive
(Empty)
(Identifier)))
(Empty))
([]))
{+(Pattern
{+(DefaultPattern
{+([])+})+}
{+(Empty)+})+})))))
{+([])+})+})))))

View File

@ -37,10 +37,27 @@
(Identifier))
(Integer)
(Empty))))
(Call
(Identifier)
(Integer)
(Empty)))
(
(Call
(Identifier)
(Integer)
(Empty))
(PostDecrement
(Identifier))
(If
(
(Identifier))
(
(Send
(Identifier)
(Composite
(Identifier)
(
(Identifier)
(Identifier))))
(Return
(Empty)))
(Empty))))
(Pattern
(DefaultPattern
([]))
@ -54,15 +71,15 @@
(Receive
(Empty)
(Identifier)))
(Empty))
([]))
(Pattern
(Receive
(Empty)
(Receive
(Empty)
(Identifier)))
(Empty))
([]))
(Pattern
(DefaultPattern
([]))
(Empty)))))))
([])))))))

View File

@ -37,10 +37,27 @@
(Identifier))
(Integer)
(Empty))))
(Call
(Identifier)
(Integer)
(Empty)))
(
(Call
(Identifier)
(Integer)
(Empty))
(PostIncrement
(Identifier))
(If
(
(Identifier))
(
(Send
(Identifier)
(Composite
(Identifier)
(
(Identifier)
(Identifier))))
(Return
(Empty)))
(Empty))))
(Pattern
(DefaultPattern
([]))
@ -54,11 +71,11 @@
(Receive
(Empty)
(Identifier)))
(Empty))
([]))
(Pattern
(Receive
(Empty)
(Receive
(Empty)
(Identifier)))
(Empty)))))))
([])))))))