mirror of
https://github.com/photoprism/photoprism.git
synced 2025-10-12 12:10:31 +08:00
People: Add unit tests #22
This commit is contained in:
@@ -58,6 +58,10 @@ func TestUnmarshalEmbedding(t *testing.T) {
|
||||
r := UnmarshalEmbedding("-0.013,-0.031]")
|
||||
assert.Nil(t, r)
|
||||
})
|
||||
t.Run("invalid json", func(t *testing.T) {
|
||||
r := UnmarshalEmbedding("[true, false]")
|
||||
assert.Equal(t, []float64{0, 0}, r)
|
||||
})
|
||||
}
|
||||
|
||||
func TestUnmarshalEmbeddings(t *testing.T) {
|
||||
@@ -69,4 +73,8 @@ func TestUnmarshalEmbeddings(t *testing.T) {
|
||||
r := UnmarshalEmbeddings("-0.013,-0.031]")
|
||||
assert.Nil(t, r)
|
||||
})
|
||||
t.Run("invalid json", func(t *testing.T) {
|
||||
r := UnmarshalEmbeddings("[[true, false]]")
|
||||
assert.Equal(t, [][]float64{{0, 0}}, r)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user