NetNewsWire/Frameworks/RSParser/RSParserTests/AtomParserTests.swift

40 lines
898 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// AtomParserTests.swift
// RSParser
//
// Created by Brent Simmons on 6/26/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
//
import XCTest
import RSParser
class AtomParserTests: XCTestCase {
func testDaringFireballPerformance() {
// 0.009 sec on my 2012 iMac.
let d = parserData("DaringFireball", "atom", "http://daringfireball.net/") //Its actually an Atom feed
self.measure {
let _ = try! FeedParser.parse(d)
}
}
func testAllThisPerformance() {
// 0.003 sec on my 2012 iMac.
let d = parserData("allthis", "atom", "http://leancrew.com/all-this")
self.measure {
let _ = try! FeedParser.parse(d)
}
}
func testGettingHomePageLink() {
let d = parserData("allthis", "atom", "http://leancrew.com/all-this")
let parsedFeed = try! FeedParser.parse(d)!
XCTAssertTrue(parsedFeed.homePageURL == "http://leancrew.com/all-this")
}
}