From: Nick Porter Date: Fri, 3 Feb 2023 15:50:49 +0000 (+0000) Subject: Tidy and expand pairs keyword test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e610b5ada9fef4a05c2dfa6b2cc965156c70451;p=thirdparty%2Ffreeradius-server.git Tidy and expand pairs keyword test --- diff --git a/src/tests/keywords/pairs b/src/tests/keywords/pairs index 16fb0bc87c0..224178b474e 100644 --- a/src/tests/keywords/pairs +++ b/src/tests/keywords/pairs @@ -16,21 +16,23 @@ &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