From 7b25fa373a9242b88a35e7764e3ae22023572c7f Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:33:32 +0800 Subject: [PATCH] docs: introduce how to generate a random phone number (#594) Co-authored-by: rick --- README.md | 4 ++-- docs/site/content/zh/latest/tasks/template.md | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 docs/site/content/zh/latest/tasks/template.md diff --git a/README.md b/README.md index 44ecfb8..cbbf7be 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ docker run -p 1234:8080 -v /var/tmp:/var/tmp \ ## Template -The following fields are templated with [sprig](http://masterminds.github.io/sprig/): +The following fields are templated with [sprig](https://masterminds.github.io/sprig/): * API * Request Body @@ -102,7 +102,7 @@ The following fields are templated with [sprig](http://masterminds.github.io/spr ### Functions -You could use all the common functions which comes from [sprig](http://masterminds.github.io/sprig/). Besides some specific functions are available: +You could use all the common functions which comes from [sprig](https://masterminds.github.io/sprig/). Besides some specific functions are available: | Name | Usage | |---|---| diff --git a/docs/site/content/zh/latest/tasks/template.md b/docs/site/content/zh/latest/tasks/template.md new file mode 100644 index 0000000..f3dc49f --- /dev/null +++ b/docs/site/content/zh/latest/tasks/template.md @@ -0,0 +1,13 @@ ++++ +title = "用例模板" ++++ + +`atest` 采用 [sprig](https://masterminds.github.io/sprig/) 作为测试用例的模板引擎。通过模板函数可以生成很多随机数据: + +## 手机号 + +下面的代码可以生成 `182` 开头的手机号: + +``` +182{{shuffle "09876543"}} +``` \ No newline at end of file