From 21644da9528f5c920a01d4b8178bfa4a8aa70868 Mon Sep 17 00:00:00 2001 From: Aaron Chen <462826@qq.com> Date: Sat, 13 Jul 2019 09:28:46 +0800 Subject: [PATCH] format test script content --- .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 7 +++++++ .idea/zentaoatf.iml | 8 ++++++++ src/gen-project.go | 6 +++--- xdoc/sample/README | 1 + xdoc/script-template.txt | 10 +++++++--- xdoc/scripts/tc-100.php | 13 ++++++++----- xdoc/scripts/tc-200.php | 17 ++++++++++------- xdoc/scripts/tc-300.php | 9 ++++++--- xdoc/scripts/tc-400.php | 9 ++++++--- 11 files changed, 70 insertions(+), 24 deletions(-) create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/zentaoatf.iml create mode 100644 xdoc/sample/README diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..28a804d8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..97516649 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..ade06b67 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/zentaoatf.iml b/.idea/zentaoatf.iml new file mode 100644 index 00000000..c956989b --- /dev/null +++ b/.idea/zentaoatf.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/gen-project.go b/src/gen-project.go index 91b93bee..b1550509 100644 --- a/src/gen-project.go +++ b/src/gen-project.go @@ -44,7 +44,7 @@ func DealwithTestCase(tc model.TestCase, langType string, independentExpect bool } template := utils.ReadFile("xdoc/script-template.txt") - content := string(fmt.Sprintf(string(template), langType, caseTitle, caseId, + content := string(fmt.Sprintf(string(template), langType, caseId, caseTitle, strings.Join(steps, "\n"), expectsTxt, strings.Join(srcCode, "\n"))) fmt.Println(content) @@ -100,7 +100,7 @@ func DealwithTestStep(ts model.TestStep, langType string, level int, stepWidth i expectsLine := "" expectsLine = "# \n" - expectsLine += "/* " + stepIdent + " 期望结果, 可以有多行 */\n" + expectsLine += "/* " + stepIdent + "期望结果, 可以有多行 */\n" *expects = append(*expects, expectsLine) } @@ -115,7 +115,7 @@ func DealwithTestStep(ts model.TestStep, langType string, level int, stepWidth i codeLine += `println("#")\n` } - codeLine += " // 开始" + stepIdent + " - " + stepExpect + "\n" + codeLine += " // " + stepIdent + ": " + stepExpect + "\n" codeLine += "/* 输出验证点实际结果 */\n" *srcCode = append(*srcCode, codeLine) diff --git a/xdoc/sample/README b/xdoc/sample/README new file mode 100644 index 00000000..17498c84 --- /dev/null +++ b/xdoc/sample/README @@ -0,0 +1 @@ +TODO: \ No newline at end of file diff --git a/xdoc/script-template.txt b/xdoc/script-template.txt index cb7cc15f..b2ea8849 100644 --- a/xdoc/script-template.txt +++ b/xdoc/script-template.txt @@ -1,12 +1,16 @@ diff --git a/xdoc/scripts/tc-200.php b/xdoc/scripts/tc-200.php index f3b4610c..2d6ae94a 100644 --- a/xdoc/scripts/tc-200.php +++ b/xdoc/scripts/tc-200.php @@ -1,8 +1,8 @@ diff --git a/xdoc/scripts/tc-300.php b/xdoc/scripts/tc-300.php index e8194fa5..8823c5fa 100644 --- a/xdoc/scripts/tc-300.php +++ b/xdoc/scripts/tc-300.php @@ -1,12 +1,15 @@