// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package atom // import "miniflux.app/v2/internal/reader/atom" import ( "bytes" "testing" ) func TestDetectAtom10(t *testing.T) { data := ` Example Feed 2003-12-13T18:30:02Z John Doe urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6 Atom-Powered Robots Run Amok urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 2003-12-13T18:30:02Z Some text. ` version := getAtomFeedVersion(bytes.NewBufferString(data)) if version != "1.0" { t.Errorf(`Invalid Atom version detected: %s`, version) } } func TestDetectAtom03(t *testing.T) { data := ` dive into mark 2003-12-13T18:30:02Z Mark Pilgrim Atom 0.3 snapshot tag:diveintomark.org,2003:3.2397 2003-12-13T08:29:29-04:00 2003-12-13T18:30:02Z This is a test HTML content

]]>
` version := getAtomFeedVersion(bytes.NewBufferString(data)) if version != "0.3" { t.Errorf(`Invalid Atom version detected: %s`, version) } }