]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Tidy and expand pairs keyword test
authorNick Porter <nick@portercomputing.co.uk>
Fri, 3 Feb 2023 15:50:49 +0000 (15:50 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 9 Feb 2023 18:41:41 +0000 (12:41 -0600)
src/tests/keywords/pairs

index 16fb0bc87c02bcf0e4164532e9b869fe10259405..224178b474ef1c1f2bcd67cca3926c8d94b7d0e6 100644 (file)
        &Tmp-String-3 = "%(concat:%(pairs:Tmp-String-0[*]) ', ')"
        &Tmp-String-4 = "%(concat:%(pairs:control.[*]) ', ')"
        &Tmp-String-5 = "%(pairs:control.User-Name)"
+       &Tmp-String-6 = "%(pairs:request)"
+       &Tmp-String-7 = "%(pairs:request.[*])"
 }
 
-if !(&Tmp-String-1 == "User-Name = \"bob\", User-Password = \"hello\", Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\", Tmp-Octets-0 = 0x000504030201, Tmp-Integer-0 = 7331") {
+if !(&Tmp-String-1 == 'User-Name = "bob", User-Password = "hello", Tmp-String-0 = "This is a string", Tmp-String-0 = "This is another one", Tmp-Octets-0 = 0x000504030201, Tmp-Integer-0 = 7331') {
        test_fail
 }
 
-if !(&Tmp-String-2 == "Tmp-String-0 = \"This is a string\"") {
+if !(&Tmp-String-2 == 'Tmp-String-0 = "This is a string"') {
        test_fail
 }
 
-if !(&Tmp-String-3 == "Tmp-String-0 = \"This is a string\", Tmp-String-0 = \"This is another one\"") {
+if !(&Tmp-String-3 == 'Tmp-String-0 = "This is a string", Tmp-String-0 = "This is another one"') {
        test_fail
 }
 
-if !(&Tmp-String-4 == "Password.Cleartext = \"hello\"") {
+if !(&Tmp-String-4 == 'Password.Cleartext = "hello"') {
        test_fail
 }
 
@@ -38,4 +40,12 @@ if (!(&Tmp-String-5 == '')) {
        test_fail
 }
 
+if !(&Tmp-String-6 == 'request = { User-Name = "bob", User-Password = "hello", Tmp-String-0 = "This is a string", Tmp-String-0 = "This is another one", Tmp-Octets-0 = 0x000504030201, Tmp-Integer-0 = 7331 }') {
+       test_fail
+}
+
+if !(&Tmp-String-7 == 'User-Name = "bob"User-Password = "hello"Tmp-String-0 = "This is a string"Tmp-String-0 = "This is another one"Tmp-Octets-0 = 0x000504030201Tmp-Integer-0 = 7331') {
+       test_fail
+}
+
 success