refactor: Adapt to new repository

This commit is contained in:
T. R. Bernstein
2025-09-30 18:48:15 +02:00
parent 17af3bace1
commit 6811c71bd6
66 changed files with 224 additions and 622 deletions

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil
@@ -17,7 +11,7 @@ final class EnvironmentBaseAndChildTemplateTests: XCTestCase {
override func setUp() {
super.setUp()
let path = Path(#file as String) + ".." + "fixtures"
let path = Path(#file as String)! / ".." / "fixtures"
let loader = FileSystemLoader(paths: [path])
environment = Environment(loader: loader)
childTemplate = ""

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil
@@ -17,7 +11,7 @@ final class EnvironmentIncludeTemplateTests: XCTestCase {
override func setUp() {
super.setUp()
let path = Path(#file as String) + ".." + "fixtures"
let path = Path(#file as String)! / ".." / "fixtures"
let loader = FileSystemLoader(paths: [path])
environment = Environment(loader: loader)
template = ""

View File

@@ -1,10 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest
@@ -11,7 +5,7 @@ import XCTest
final class ExpressionsTests: XCTestCase {
private let parser = TokenParser(tokens: [], environment: Environment())
private func makeExpression(_ components: [String]) -> Expression {
private func makeExpression(_ components: [String]) -> Stencil.Expression {
do {
let parser = try IfExpressionParser.parser(
components: components,

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil
@@ -11,7 +5,7 @@ import XCTest
extension Expectation {
@discardableResult
func toThrow<T: Error>() throws -> T {
func toThrow<E: Error>() throws -> E {
var thrownError: Error?
do {
@@ -21,7 +15,7 @@ extension Expectation {
}
if let thrownError = thrownError {
if let thrownError = thrownError as? T {
if let thrownError = thrownError as? E {
return thrownError
} else {
throw failure("\(thrownError) is not \(T.self)")

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,16 +1,10 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil
import XCTest
final class IncludeTests: XCTestCase {
private let path = Path(#file as String) + ".." + "fixtures"
private let path = Path(#file as String)! / ".." / "fixtures"
private lazy var loader = FileSystemLoader(paths: [path])
private lazy var environment = Environment(loader: loader)

View File

@@ -1,16 +1,10 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
import Stencil
import XCTest
final class InheritanceTests: XCTestCase {
private let path = Path(#file as String) + ".." + "fixtures"
private let path = Path(#file as String)! / ".." / "fixtures"
private lazy var loader = FileSystemLoader(paths: [path])
private lazy var environment = Environment(loader: loader)

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
@testable import Stencil
@@ -140,8 +134,8 @@ final class LexerTests: XCTestCase {
}
func testPerformance() throws {
let path = Path(#file as String) + ".." + "fixtures" + "huge.html"
let content: String = try path.read()
let path = Path(#file as String)! / ".." / "fixtures" / "huge.html"
let content: String = try NSString(contentsOfFile: path.string, encoding: String.Encoding.utf8.rawValue).substring(from: 0) as String
measure {
let lexer = Lexer(templateString: content)

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import PathKit
import Spectre
import Stencil
@@ -11,7 +5,7 @@ import XCTest
final class TemplateLoaderTests: XCTestCase {
func testFileSystemLoader() {
let path = Path(#file as String) + ".." + "fixtures"
let path = Path(#file as String)! / ".." / "fixtures"
let loader = FileSystemLoader(paths: [path])
let environment = Environment(loader: loader)

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
import Stencil
import XCTest

View File

@@ -1,9 +1,3 @@
//
// Stencil
// Copyright © 2022 Stencil
// MIT Licence
//
import Spectre
@testable import Stencil
import XCTest