summaryrefslogtreecommitdiffstats
path: root/src/tests/keywords/foreach-varied-depth
blob: 3c3918d6c2b8a3841e8eca041d9094fd7b8479b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
update {
	control:Tmp-String-0 := "ssid=ABCDEF"
	control:Tmp-String-0 += "ssid=GHIJKL"
	reply:Filter-Id := "filter"
}

if (User-Name) {
	foreach &control:Tmp-String-0 {
		if ("%{Foreach-Variable-0}" =~ /(.*)/) {
			update control {
				Tmp-String-1 := "%{1}"
			}
		}
	}
}

if (&control:Tmp-String-1 != 'ssid=GHIJKL') {
	update reply {
		Filter-Id += 'fail 0'
	}
}

update control {
	Tmp-String-1 !* ANY
}

foreach &control:Tmp-String-0 {
	if ("%{Foreach-Variable-0}" =~ /(.*)/) {
		update control {
			Tmp-String-1 := "%{1}"
		}
	}
}

if (&control:Tmp-String-1 != 'ssid=GHIJKL') {
	update reply {
		Filter-Id += 'fail 1'
	}
}

update control {
	Tmp-String-1 !* ANY
}