Parses multiple values for a property

pull/2/head
Ian Davis 2012-06-07 00:57:36 +01:00
parent 433c1b7111
commit d6e293d40a
1 changed files with 10 additions and 3 deletions

View File

@ -250,8 +250,15 @@ func TestReadTwoValues(t *testing.T) {
</div>` </div>`
item := ReadOneItem(html, t) item := ReadOneItem(html, t)
if len(item.properties["flavor"]) != 2 {
t.Errorf("Expecting 2 items but got %d",len(item.properties["flavor"]) )
}
if item.properties["flavor"][0].(string) != "Lemon sorbet" {
t.Errorf("Property value 'Lemon sorbet' not found")
}
if item.properties["flavor"][1].(string) != "Apricot sorbet" {
t.Errorf("Property value 'Apricot sorbet' not found")
}
if item.properties["birthday"][0].(string) != "2009-05-10" {
t.Errorf("Property value not found")
}
} }