Test: SIL issues, #file as String

This commit is contained in:
kawoou
2019-04-15 13:35:33 +09:00
parent 3c973689a4
commit 4020a9851a
5 changed files with 6 additions and 16 deletions

View File

@@ -215,8 +215,7 @@ final class EnvironmentIncludeTemplateTests: XCTestCase {
override func setUp() {
super.setUp()
let basePath: String = #file
let path = Path(basePath) + ".." + "fixtures"
let path = Path(#file as String) + ".." + "fixtures"
let loader = FileSystemLoader(paths: [path])
environment = Environment(loader: loader)
template = ""
@@ -292,8 +291,7 @@ final class EnvironmentBaseAndChildTemplateTests: XCTestCase {
override func setUp() {
super.setUp()
let basePath: String = #file
let path = Path(basePath) + ".." + "fixtures"
let path = Path(#file as String) + ".." + "fixtures"
let loader = FileSystemLoader(paths: [path])
environment = Environment(loader: loader)
childTemplate = ""

View File

@@ -4,10 +4,7 @@ import Spectre
import XCTest
final class IncludeTests: XCTestCase {
let path: Path = {
let basePath: String = #file
return Path(basePath) + ".." + "fixtures"
}()
let path = Path(#file as String) + ".." + "fixtures"
lazy var loader = FileSystemLoader(paths: [path])
lazy var environment = Environment(loader: loader)

View File

@@ -4,10 +4,7 @@ import Stencil
import XCTest
final class InheritanceTests: XCTestCase {
let path: Path = {
let basePath: String = #file
return Path(basePath) + ".." + "fixtures"
}()
let path = Path(#file as String) + ".." + "fixtures"
lazy var loader = FileSystemLoader(paths: [path])
lazy var environment = Environment(loader: loader)

View File

@@ -117,8 +117,7 @@ final class LexerTests: XCTestCase {
}
func testPerformance() throws {
let basePath: String = #file
let path = Path(basePath) + ".." + "fixtures" + "huge.html"
let path = Path(#file as String) + ".." + "fixtures" + "huge.html"
let content: String = try path.read()
measure {

View File

@@ -5,8 +5,7 @@ import XCTest
final class TemplateLoaderTests: XCTestCase {
func testFileSystemLoader() {
let basePath: String = #file
let path = Path(basePath) + ".." + "fixtures"
let path = Path(#file as String) + ".." + "fixtures"
let loader = FileSystemLoader(paths: [path])
let environment = Environment(loader: loader)