2023-01-13 19:36:10 +08:00
|
|
|
package firewallconfigs_test
|
2020-10-06 21:02:21 +08:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
2023-01-13 19:36:10 +08:00
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
|
2020-10-06 21:02:21 +08:00
|
|
|
"strings"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestRuleOperator_Markdown(t *testing.T) {
|
2023-01-13 19:36:10 +08:00
|
|
|
var result = []string{}
|
|
|
|
|
for _, def := range firewallconfigs.AllRuleOperators {
|
|
|
|
|
def.Description = strings.ReplaceAll(def.Description, "<code-label>", "`")
|
|
|
|
|
def.Description = strings.ReplaceAll(def.Description, "</code-label>", "`")
|
|
|
|
|
|
|
|
|
|
var row = "## " + def.Name + "\n"
|
|
|
|
|
row += "* 名称:" + def.Name + "\n"
|
|
|
|
|
row += "* 代号:`" + def.Code + "`\n"
|
|
|
|
|
row += "* 描述:" + def.Description + "\n"
|
2020-10-06 21:02:21 +08:00
|
|
|
result = append(result, row)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt.Print(strings.Join(result, "\n") + "\n")
|
|
|
|
|
}
|