mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-03 04:10:25 +08:00
30 lines
865 B
Go
30 lines
865 B
Go
// Copyright 2022 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||
|
||
package firewallconfigs_test
|
||
|
||
import (
|
||
"fmt"
|
||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
|
||
"strings"
|
||
"testing"
|
||
)
|
||
|
||
func TestRuleCheckpoint_Markdown(t *testing.T) {
|
||
var result = []string{}
|
||
for _, def := range firewallconfigs.AllCheckpoints {
|
||
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.Prefix + "}`\n"
|
||
row += "* 描述:" + def.Description + "\n"
|
||
if len(def.Version) > 0 {
|
||
row += "* 版本:v" + def.Version + "\n"
|
||
}
|
||
result = append(result, row)
|
||
}
|
||
|
||
fmt.Print(strings.Join(result, "\n") + "\n")
|
||
}
|