From 34c02dec90a2b0c711f734bb6bbd980e26fb8985 Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Thu, 18 Jun 2020 10:06:08 +0800 Subject: [PATCH] =?UTF-8?q?linux=E4=B8=8B=E5=AF=B9=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E8=BD=AC=E6=8D=A2=E7=9A=84=E4=B8=8D=E8=AF=86=E5=88=AB?= =?UTF-8?q?'${str}'.rindex('}')=20+=201=20=E8=B0=83=E6=95=B4=E4=B8=BA?= =?UTF-8?q?=EF=BC=9A${testStr1}=20=20=20=20=20=20Catenate=20=20=20=20'''?= =?UTF-8?q?=20=20=20=20${str}=20=20=20=20=20=20=20'''=20=20=20=20=20${test?= =?UTF-8?q?Index3}=20=20=20=20Evaluate=20=20=20=20${testStr1}.rindex(?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit windows、linux下测试通过。 --- 02-Keyword/tsg_cli/Interface.robot | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/02-Keyword/tsg_cli/Interface.robot b/02-Keyword/tsg_cli/Interface.robot index 02a3bc6..46a68eb 100644 --- a/02-Keyword/tsg_cli/Interface.robot +++ b/02-Keyword/tsg_cli/Interface.robot @@ -384,9 +384,22 @@ Run1_B Should Contain ${r} Success ${str} Replace String ${r} ${\n} - ${str} Replace String ${str} ' \\' - ${index} Evaluate '${str}'.rindex('}') + 1 - ${len} Convert To Integer ${index} - ${json} Evaluate '${str}'[0:${len}] + #${index} Evaluate '${str}'.rindex('}') + 1 + #${len} Convert To Integer ${index} + #${json} Evaluate '${str}'[0:${len}] + + #${testStr} Catenate ''' ${str} ''' + #${testIndex3} Evaluate ${testStr}.rindex('}') + #Log ${testIndex3} + #${len} Convert To Integer ${testIndex3} + #${json} Get Substring ${str} 0 ${len} + + ${testStr1} Catenate ''' ${str} ''' + ${testIndex3} Evaluate ${testStr1}.rindex('-') - 1 + Log ${testIndex3} + ${len} Convert To Integer ${testIndex3} + ${json} Get Substring ${str} 0 ${len} + Log ${json} ${dict} json.Loads ${json} Should Be True ${dict}[data][total] > 0 [Return] ${dict} @@ -436,6 +449,7 @@ Run5 Should Not Be Empty ${r} #用换行符作为命令结束 ${str} Replace String ${r} ${\n} - + ${index} Evaluate '${str}'.rindex('-') ${len} Convert To Integer ${index} ${json} Evaluate '${str}'[0:${len}]