From bf1ddaa60f1ad01f7388b16270c0564ea07828a4 Mon Sep 17 00:00:00 2001 From: Kare Morstol Date: Tue, 30 Jun 2015 23:28:24 +0200 Subject: [PATCH] Add timing test for large file. --- FootlessParser.xcodeproj/project.pbxproj | 1 + tests/Grammar_Tests/CSV.swift | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/FootlessParser.xcodeproj/project.pbxproj b/FootlessParser.xcodeproj/project.pbxproj index fa1d792..2130d72 100644 --- a/FootlessParser.xcodeproj/project.pbxproj +++ b/FootlessParser.xcodeproj/project.pbxproj @@ -447,6 +447,7 @@ BAC6B2161A61D92B005643D9 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0610; ORGANIZATIONNAME = "NotTooBad Software"; TargetAttributes = { diff --git a/tests/Grammar_Tests/CSV.swift b/tests/Grammar_Tests/CSV.swift index 7ebbf1a..b3e938a 100644 --- a/tests/Grammar_Tests/CSV.swift +++ b/tests/Grammar_Tests/CSV.swift @@ -43,4 +43,19 @@ class CSV: XCTestCase { } } } + + func testParseLargeCSVQuotesReturningArray () { + let filepath = pathForTestResource("CSV-quotes-large", type: "csv") + let movieratings = String(contentsOfFile: filepath, encoding: NSUTF8StringEncoding, error: nil)! + + measureBlock { + let result = parse(zeroOrMore(row), movieratings) + if let success = result.value { + XCTAssertEqual(success.count, 1715) + } else if let failure = result.error { + XCTFail(failure) + } + } + } + }