-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This updates the EndIf tests to more carefully ensure that the priority after the EndIf application is not skipped.
- Loading branch information
1 parent
d9b7d1d
commit 1cf3642
Showing
1 changed file
with
27 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,38 @@ | ||
[default] | ||
exten => s,1,Answer() | ||
same => n,If(1) | ||
same => n,NoOp(inside main if) | ||
same => n,If(0) | ||
same => n,NoOp() | ||
same => n,EndIf() | ||
same => n,NoOp(after nested false if) | ||
same => n,If(1) | ||
same => n,NoOp(inside true nested if) | ||
same => n,EndIf() | ||
same => n,NoOp(after nested true if) | ||
same => n,If(0) | ||
same => n,NoOp() | ||
same => n,EndIf() | ||
same => n,If(0) | ||
same => n,Hangup() ; shouldn't be executed | ||
same => n,EndIf() | ||
same => n,If(1) | ||
same => n,NoOp() | ||
same => n,EndIf() | ||
; After EndIf, we should go to the next priority (and goto start) | ||
same => n,Goto(start) | ||
same => n,Hangup() | ||
same => n(start),If(1) | ||
same => n,NoOp(inside main if) | ||
same => n,If(0) | ||
same => n,NoOp() | ||
same => n,EndIf() | ||
same => n,NoOp(after nested false if) | ||
same => n,If(1) | ||
same => n,NoOp(inside true nested if) | ||
same => n,EndIf() | ||
same => n,NoOp(after nested true if) | ||
; Test success: we exited only the inside If, not the outside If | ||
same => n,UserEvent(IfSuccess,Result: Pass) | ||
same => n,If(1) | ||
same => n,NoOp(inside true nested if) | ||
same => n,NoOp(inside true nested if) | ||
same => n,ExitIf() | ||
same => n,EndIf() | ||
same => n,EndIf() | ||
; Test success: we exited only the inside If, not the outside If | ||
same => n,UserEvent(IfSuccess,Result: Pass) | ||
same => n,Hangup() | ||
same => n,EndIf() | ||
same => n,EndIf() | ||
; Test failed: we shouldn't reach the exterior EndIf | ||
same => n,UserEvent(IfSuccess,Result: Fail) | ||
same => n,Assert(0) | ||
same => n,NoOp(after main if) | ||
same => n,Hangup() | ||
same => n,NoOp(after main if) | ||
same => n,Hangup() |