Update from Hummingbird Project Template (#58)

* Update from hummingbird-project-template 572d468b2cabeca286314c5a35196bd42445c8ef

* run swift-format

* Remove .swiftformat

---------

Co-authored-by: adam-fowler <adam-fowler@users.noreply.github.com>
Co-authored-by: Adam Fowler <adamfowler71@gmail.com>
This commit is contained in:
hummingbird-automation[bot]
2024-11-28 07:31:09 +00:00
committed by GitHub
parent 8c5c8ead74
commit ec4ef9aa04
21 changed files with 663 additions and 430 deletions

View File

@@ -17,11 +17,15 @@ import XCTest
final class ErrorTests: XCTestCase {
func testSectionCloseNameIncorrect() {
XCTAssertThrowsError(try MustacheTemplate(string: """
{{#test}}
{{.}}
{{/test2}}
""")) { error in
XCTAssertThrowsError(
try MustacheTemplate(
string: """
{{#test}}
{{.}}
{{/test2}}
"""
)
) { error in
switch error {
case let error as MustacheTemplate.ParserError:
XCTAssertEqual(error.error as? MustacheTemplate.Error, .sectionCloseNameIncorrect)
@@ -36,11 +40,15 @@ final class ErrorTests: XCTestCase {
}
func testUnfinishedName() {
XCTAssertThrowsError(try MustacheTemplate(string: """
{{#test}}
{{name}
{{/test2}}
""")) { error in
XCTAssertThrowsError(
try MustacheTemplate(
string: """
{{#test}}
{{name}
{{/test2}}
"""
)
) { error in
switch error {
case let error as MustacheTemplate.ParserError:
XCTAssertEqual(error.error as? MustacheTemplate.Error, .unfinishedName)
@@ -55,10 +63,14 @@ final class ErrorTests: XCTestCase {
}
func testExpectedSectionEnd() {
XCTAssertThrowsError(try MustacheTemplate(string: """
{{#test}}
{{.}}
""")) { error in
XCTAssertThrowsError(
try MustacheTemplate(
string: """
{{#test}}
{{.}}
"""
)
) { error in
switch error {
case let error as MustacheTemplate.ParserError:
XCTAssertEqual(error.error as? MustacheTemplate.Error, .expectedSectionEnd)
@@ -73,11 +85,15 @@ final class ErrorTests: XCTestCase {
}
func testInvalidSetDelimiter() {
XCTAssertThrowsError(try MustacheTemplate(string: """
{{=<% %>=}}
<%.%>
<%={{}}=%>
""")) { error in
XCTAssertThrowsError(
try MustacheTemplate(
string: """
{{=<% %>=}}
<%.%>
<%={{}}=%>
"""
)
) { error in
switch error {
case let error as MustacheTemplate.ParserError:
XCTAssertEqual(error.error as? MustacheTemplate.Error, .invalidSetDelimiter)