14 lines
487 B
Go
14 lines
487 B
Go
package knowledge
|
|
|
|
import "testing"
|
|
|
|
func TestNormalizeGraphInputSupportsMultipleDiseases(t *testing.T) {
|
|
items, relations, err := normalizeGraphInput(GraphInput{Symptoms: []SymptomInput{{Key: "poor_appetite", Name: "食欲下降", Diseases: []GraphItemInput{{Key: "gi", Name: "肠胃不适"}, {Key: "dental", Name: "口腔问题"}}}}})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(items) != 3 || len(relations) != 2 {
|
|
t.Fatalf("items=%d relations=%d", len(items), len(relations))
|
|
}
|
|
}
|