feat: 完善环境规则、会诊治理、知识审核与效果评估
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package model
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestValidKnowledgeTransition(t *testing.T) {
|
||||
ok := [][2]string{
|
||||
{"draft", "review"},
|
||||
{"review", "published"},
|
||||
{"published", "withdrawn"},
|
||||
{"withdrawn", "review"},
|
||||
}
|
||||
for _, tr := range ok {
|
||||
if !ValidKnowledgeTransition(tr[0], tr[1]) {
|
||||
t.Errorf("expected %s -> %s", tr[0], tr[1])
|
||||
}
|
||||
}
|
||||
if ValidKnowledgeTransition("draft", "published") {
|
||||
t.Error("draft 不能直接 published")
|
||||
}
|
||||
if ValidKnowledgeTransition("published", "draft") {
|
||||
t.Error("published 不能回草稿")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user