Warnings--

This commit is contained in:
David Jennes
2022-07-27 04:47:19 +02:00
parent e6ee27f64e
commit f32c772b99
39 changed files with 772 additions and 614 deletions

View File

@@ -2,20 +2,8 @@ import Spectre
import Stencil
import XCTest
private struct CustomNode: NodeType {
let token: Token?
func render(_ context: Context) throws -> String {
return "Hello World"
}
}
private struct Article {
let title: String
let author: String
}
final class StencilTests: XCTestCase {
lazy var environment: Environment = {
private lazy var environment: Environment = {
let exampleExtension = Extension()
exampleExtension.registerSimpleTag("simpletag") { _ in
"Hello World"
@@ -32,7 +20,7 @@ final class StencilTests: XCTestCase {
There are {{ articles.count }} articles.
{% for article in articles %}\
- {{ article.title }} by {{ article.author }}.
- {{ article.title }} by {{ article.author }}.
{% endfor %}
"""
@@ -49,8 +37,8 @@ final class StencilTests: XCTestCase {
try expect(result) == """
There are 2 articles.
- Migrating from OCUnit to XCTest by Kyle Fuller.
- Memory Management with ARC by Kyle Fuller.
- Migrating from OCUnit to XCTest by Kyle Fuller.
- Memory Management with ARC by Kyle Fuller.
"""
}
@@ -66,3 +54,17 @@ final class StencilTests: XCTestCase {
}
}
}
// MARK: - Helpers
private struct CustomNode: NodeType {
let token: Token?
func render(_ context: Context) throws -> String {
"Hello World"
}
}
private struct Article {
let title: String
let author: String
}