17 lines
365 B
Go
17 lines
365 B
Go
|
|
package model
|
||
|
|
|
||
|
|
import (
|
||
|
|
"encoding/json"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestSemanticFeaturesUnmarshalLegacyConfidence(t *testing.T) {
|
||
|
|
var semantic SemanticFeatures
|
||
|
|
if err := json.Unmarshal([]byte(`{"description":"x","confidence":"medium"}`), &semantic); err != nil {
|
||
|
|
t.Fatal(err)
|
||
|
|
}
|
||
|
|
if semantic.Confidence != 0.70 {
|
||
|
|
t.Fatalf("confidence = %v", semantic.Confidence)
|
||
|
|
}
|
||
|
|
}
|