Skip to content

Commit

Permalink
Merge pull request #46 from meatball133/1.1.1
Browse files Browse the repository at this point in the history
[1.1.1]: Various fixes
  • Loading branch information
meatball133 authored Jul 4, 2023
2 parents 0994549 + ebb6cb2 commit c743b1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.1.1

- Fixed an issue causing help functions to be marked as test cases
- Made the output when writting a compile error shorter

# 1.1.0

- The test runner will run one test at a time, this is to be able to give a better error message when a test fails.
Expand Down
3 changes: 2 additions & 1 deletion src/testrunner/Sources/TestRunner/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class TestRunner{
let bodyCheck = node.body
if bodyCheck != nil{
let name: String = String(describing: node.identifier)
guard name.hasPrefix("test") else { return SyntaxVisitorContinueKind.visitChildren }
var body: String = String(describing: bodyCheck!).trimmingCharacters(in: charactersToRemove)
body = String(body[body.index(after: body.startIndex)..<body.index(before: body.endIndex)]).trimmingCharacters(in: charactersToRemove)
var bodyList = body.components(separatedBy: "\n")
Expand Down Expand Up @@ -247,7 +248,7 @@ class TestRunner{
let message = something.components(separatedBy: "\n")[1...]
var start = 0
for (rowIdx, row) in message.enumerated(){
if row.contains("CompileError.swift:") || row.contains("\(camelCase(slug: slug))Tests.swift:"){
if row.contains("CompileError.swift:") || row.contains("\(camelCase(slug: slug))Tests.swift:") || row.contains("\(camelCase(slug: slug)).swift:") {
start = rowIdx + 1
break
}
Expand Down

0 comments on commit c743b1c

Please sign in to comment.