Add performance test (no reporting yet)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import XCTest
|
||||
import PathKit
|
||||
import Spectre
|
||||
@testable import Stencil
|
||||
import XCTest
|
||||
|
||||
class LexerTests: XCTestCase {
|
||||
func testLexer() {
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ extension InheritenceTests {
|
||||
extension LexerTests {
|
||||
static let __allTests = [
|
||||
("testLexer", testLexer),
|
||||
("testPerformance", testPerformance),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
1131
Tests/StencilTests/fixtures/huge.html
Normal file
1131
Tests/StencilTests/fixtures/huge.html
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user