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
|
2024-09-10 06:49:46 +02:00
|
|
|
import FeedParser
|
2024-04-03 06:43:06 +02:00
|
|
|
|
2024-09-24 06:39:00 +02:00
|
|
|
final class RSSInJSONParserTests: XCTestCase {
|
2024-09-21 20:20:23 +02:00
|
|
|
|
|
|
|
func testScriptingNewsPerformance() {
|
|
|
|
|
|
|
|
// 0.003 sec on my 2012 iMac.
|
|
|
|
let d = parserData("ScriptingNews", "json", "http://scripting.com/")
|
|
|
|
self.measure {
|
|
|
|
let _ = try! FeedParser.parse(d)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func testFeedLanguage() {
|
|
|
|
let d = parserData("ScriptingNews", "json", "http://scripting.com/")
|
|
|
|
let parsedFeed = try! FeedParser.parse(d)!
|
|
|
|
XCTAssertEqual(parsedFeed.language, "en-us")
|
|
|
|
}
|
|
|
|
}
|