From d6e293d40a3c75a0763844fa45bb33ae4f777f85 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Thu, 7 Jun 2012 00:57:36 +0100 Subject: [PATCH] Parses multiple values for a property --- microdata_test.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/microdata_test.go b/microdata_test.go index 027a229..ba11e5a 100644 --- a/microdata_test.go +++ b/microdata_test.go @@ -250,8 +250,15 @@ func TestReadTwoValues(t *testing.T) { ` item := ReadOneItem(html, t) - - if item.properties["birthday"][0].(string) != "2009-05-10" { - t.Errorf("Property value not found") + 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") + } + + }