diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-09-13 13:13:40 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-09-13 13:13:40 +0200 |
commit | 5ff4c17907d5b19510a62e08fd8d3b11e62b431d (patch) | |
tree | c0650497e988f47be9c6f2324fa692a52dea82e1 /src/pkg/xml/atom_test.go | |
parent | 80f18fc933cf3f3e829c5455a1023d69f7b86e52 (diff) | |
download | golang-upstream/60.tar.gz |
Imported Upstream version 60upstream/60
Diffstat (limited to 'src/pkg/xml/atom_test.go')
-rw-r--r-- | src/pkg/xml/atom_test.go | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/pkg/xml/atom_test.go b/src/pkg/xml/atom_test.go new file mode 100644 index 000000000..d365510bf --- /dev/null +++ b/src/pkg/xml/atom_test.go @@ -0,0 +1,50 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xml + +var atomValue = &Feed{ + Title: "Example Feed", + Link: []Link{{Href: "http://example.org/"}}, + Updated: ParseTime("2003-12-13T18:30:02Z"), + Author: Person{Name: "John Doe"}, + Id: "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", + + Entry: []Entry{ + { + Title: "Atom-Powered Robots Run Amok", + Link: []Link{{Href: "http://example.org/2003/12/13/atom03"}}, + Id: "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", + Updated: ParseTime("2003-12-13T18:30:02Z"), + Summary: NewText("Some text."), + }, + }, +} + +var atomXml = `` + + `<feed xmlns="http://www.w3.org/2005/Atom">` + + `<Title>Example Feed</Title>` + + `<Id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</Id>` + + `<Link href="http://example.org/"></Link>` + + `<Updated>2003-12-13T18:30:02Z</Updated>` + + `<Author><Name>John Doe</Name><URI></URI><Email></Email></Author>` + + `<Entry>` + + `<Title>Atom-Powered Robots Run Amok</Title>` + + `<Id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</Id>` + + `<Link href="http://example.org/2003/12/13/atom03"></Link>` + + `<Updated>2003-12-13T18:30:02Z</Updated>` + + `<Author><Name></Name><URI></URI><Email></Email></Author>` + + `<Summary>Some text.</Summary>` + + `</Entry>` + + `</feed>` + +func ParseTime(str string) Time { + return Time(str) +} + +func NewText(text string) Text { + return Text{ + Body: text, + } +} |