[asterisk-commits] kmoore: testsuite/asterisk/trunk r3029 - /asterisk/trunk/tests/dialplan/confi...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Feb 9 13:56:58 CST 2012
Author: kmoore
Date: Thu Feb 9 13:56:55 2012
New Revision: 3029
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3029
Log:
Add test for LEN function which includes testing for config escapes
Review: https://reviewboard.asterisk.org/r/1727/
Modified:
asterisk/trunk/tests/dialplan/configs/ast1/extensions.conf
Modified: asterisk/trunk/tests/dialplan/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/dialplan/configs/ast1/extensions.conf?view=diff&rev=3029&r1=3028&r2=3029
==============================================================================
--- asterisk/trunk/tests/dialplan/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/dialplan/configs/ast1/extensions.conf Thu Feb 9 13:56:55 2012
@@ -51,6 +51,7 @@
; test dialplan functions
same => n,ExecIf($[${TestCounter} = 12]?Goto(base64,start,1))
same => n,ExecIf($[${TestCounter} = 13]?Goto(aes,start,1))
+ same => n,ExecIf($[${TestCounter} = 14]?Goto(len,start,1))
; ---------------------------------------------------------------
; NOTE: Add additional dialplan tests before the
@@ -162,6 +163,23 @@
; STRING (LEN, CUT, ISNULL, EXISTS)
; ------------------------------------------------------------------
+[len]
+exten => start,1,NoOp()
+ ; note that the \ here gets removed by the config parser
+ same => n,Set(MyStr=\;)
+ same => n,Set(LenResult=${LEN(${MyStr})})
+ same => n,Set(TestResult=${IF($["${LenResult}" = "1"]?OK:Fail)})
+ same => n,GotoIf($[${TestResult} = Fail]?test,result_fail,1)
+ same => n,Set(MyStr=)
+ same => n,Set(LenResult=${LEN(${MyStr})})
+ same => n,Set(TestResult=${IF($["${LenResult}" = "0"]?OK:Fail)})
+ same => n,GotoIf($[${TestResult} = Fail]?test,result_fail,1)
+ same => n,Set(MyStr=asdf)
+ same => n,Set(LenResult=${LEN(${MyStr})})
+ same => n,Set(TestResult=${IF($["${LenResult}" = "4"]?OK:Fail)})
+ same => n,GotoIf($[${TestResult} = Fail]?test,result_fail,1)
+ same => n,Goto(test,start,top)
+
; ------------------------------------------------------------------
; REPLACE()
; ------------------------------------------------------------------
More information about the asterisk-commits
mailing list