Skip to content

Commit

Permalink
app_if: Update tests for EndIf.
Browse files Browse the repository at this point in the history
This updates the EndIf tests to more
carefully ensure that the priority after
the EndIf application is not skipped.
  • Loading branch information
InterLinked1 authored and asterisk-org-access-app[bot] committed Jan 30, 2024
1 parent d9b7d1d commit 1cf3642
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions tests/apps/if/if_endif/configs/ast1/extensions.conf
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()

0 comments on commit 1cf3642

Please sign in to comment.