Skip to content

Commit

Permalink
Add performance test (no reporting yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Sep 25, 2018
1 parent 652dcd2 commit fff93f1
Show file tree
Hide file tree
Showing 3 changed files with 1,144 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Tests/StencilTests/LexerSpec.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import XCTest
import PathKit
import Spectre
@testable import Stencil
import XCTest

class LexerTests: XCTestCase {
func testLexer() {
Expand Down Expand Up @@ -115,4 +116,14 @@ class LexerTests: XCTestCase {
}
}
}

func testPerformance() throws {
let path = Path(#file) + ".." + "fixtures" + "huge.html"
let content: String = try path.read()

measure {
let lexer = Lexer(templateString: content)
_ = lexer.tokenize()
}
}
}
1 change: 1 addition & 0 deletions Tests/StencilTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ extension InheritenceTests {
extension LexerTests {
static let __allTests = [
("testLexer", testLexer),
("testPerformance", testPerformance),
]
}

Expand Down
Loading

0 comments on commit fff93f1

Please sign in to comment.