2024-04-03 06:43:06 +02:00
|
|
|
//
|
|
|
|
// RSSInJSONParserTests.swift
|
|
|
|
// RSParser
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 6/26/17.
|
|
|
|
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import XCTest
|
|
|
|
import Parser
|
|
|
|
|
|
|
|
class RSSInJSONParserTests: XCTestCase {
|
|
|
|
|
|
|
|
func testScriptingNewsPerformance() {
|
|
|
|
|
|
|
|
// 0.003 sec on my 2012 iMac.
|
|
|
|
let d = parserData("ScriptingNews", "json", "http://scripting.com/")
|
|
|
|
self.measure {
|
2024-05-19 04:02:36 +02:00
|
|
|
let _ = try! FeedParser.parseSync(d)
|
2024-04-03 06:43:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func testFeedLanguage() {
|
|
|
|
let d = parserData("ScriptingNews", "json", "http://scripting.com/")
|
2024-05-19 04:02:36 +02:00
|
|
|
let parsedFeed = try! FeedParser.parseSync(d)!
|
2024-04-03 06:43:06 +02:00
|
|
|
XCTAssertEqual(parsedFeed.language, "en-us")
|
|
|
|
}
|
|
|
|
}
|