Fix issues in Tests

t
This commit is contained in:
David Jennes
2018-09-21 00:00:56 +02:00
parent 3f4622f54f
commit 2d82dcb003
19 changed files with 2573 additions and 2454 deletions

View File

@@ -1,36 +1,34 @@
import XCTest
import Spectre
@testable import Stencil
import XCTest
class TokenTests: XCTestCase {
final class TokenTests: XCTestCase {
func testToken() {
describe("Token") {
$0.it("can split the contents into components") {
let token = Token.text(value: "hello world", at: .unknown)
let components = token.components
it("can split the contents into components") {
let token = Token.text(value: "hello world", at: .unknown)
let components = token.components
try expect(components.count) == 2
try expect(components[0]) == "hello"
try expect(components[1]) == "world"
}
try expect(components.count) == 2
try expect(components[0]) == "hello"
try expect(components[1]) == "world"
}
$0.it("can split the contents into components with single quoted strings") {
let token = Token.text(value: "hello 'kyle fuller'", at: .unknown)
let components = token.components
it("can split the contents into components with single quoted strings") {
let token = Token.text(value: "hello 'kyle fuller'", at: .unknown)
let components = token.components
try expect(components.count) == 2
try expect(components[0]) == "hello"
try expect(components[1]) == "'kyle fuller'"
}
try expect(components.count) == 2
try expect(components[0]) == "hello"
try expect(components[1]) == "'kyle fuller'"
}
$0.it("can split the contents into components with double quoted strings") {
let token = Token.text(value: "hello \"kyle fuller\"", at: .unknown)
let components = token.components
it("can split the contents into components with double quoted strings") {
let token = Token.text(value: "hello \"kyle fuller\"", at: .unknown)
let components = token.components
try expect(components.count) == 2
try expect(components[0]) == "hello"
try expect(components[1]) == "\"kyle fuller\""
}
try expect(components.count) == 2
try expect(components[0]) == "hello"
try expect(components[1]) == "\"kyle fuller\""
}
}
}