From 50b37d4a27d3295a29afca2286f1a5a086142cec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:49:46 +0200 Subject: Adding upstream version 3.2.1+dfsg. Signed-off-by: Daniel Baumann --- src/tests/keywords/foreach-break-2 | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/tests/keywords/foreach-break-2 (limited to 'src/tests/keywords/foreach-break-2') diff --git a/src/tests/keywords/foreach-break-2 b/src/tests/keywords/foreach-break-2 new file mode 100644 index 0000000..b1f6040 --- /dev/null +++ b/src/tests/keywords/foreach-break-2 @@ -0,0 +1,46 @@ +# +# PRE: foreach foreach-break +# + +update request { + Calling-Station-Id := "ABCDEF_8" +} + +update control { + &Tmp-String-0 := "0" + &Tmp-String-0 += "1" + &Tmp-String-0 += "2" + &Tmp-String-0 += "3" + &Tmp-String-0 += "4" + &Tmp-String-0 += "5" + &Tmp-String-0 += "6" + &Tmp-String-0 += "7" + &Tmp-String-0 += "8" + &Tmp-String-0 += "9" + &Tmp-String-0 += "a" + &Tmp-String-0 += "b" + &Tmp-String-0 += "c" + &Tmp-String-0 += "d" + &Tmp-String-0 += "e" + &Tmp-String-0 += "f" + &Tmp-String-0 += "g" +} + +foreach control:Tmp-String-0 { + if ("%{Calling-Station-Id[*]}" =~ /([A-Z0-9\-]*)_%{Foreach-Variable-0}/) { + update request { + Called-Station-Id := "%{1}" + } + update reply { + Filter-Id := "filter" + } + + break + } + elsif ("%{Foreach-Variable-0}" == '9') { + update reply { + Filter-Id := "fail-9" + } + reject + } +} -- cgit v1.2.3