Skip to content

Commit

Permalink
Small formatter pass and code change to be formatter frendly (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdp authored Jan 21, 2024
1 parent 5c8da7c commit a3d843e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions bsc-plugin/src/lib/rooibos/FileFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export class FileFactory {

public createCoverageComponent(program: Program, coverageMap: any, filepathMap: Map<number, string>) {
let template = this.coverageComponentBrsTemplate;
template = template.replace(/\#EXPECTED_MAP\#/g, JSON.stringify(coverageMap ?? {}));
template = template.replace(/\#FILE_PATH_MAP\#/g, JSON.stringify(filepathMap ?? {}));
template = template.replace(/\"\#EXPECTED_MAP\#\"/g, JSON.stringify(coverageMap ?? {}));
template = template.replace(/\"\#FILE_PATH_MAP\#\"/g, JSON.stringify(filepathMap ?? {}));

this.addFileToRootDir(program, path.join('components/rooibos', 'CodeCoverage.brs'), template);
this.addFileToRootDir(program, path.join('components/rooibos', 'CodeCoverage.xml'), this.coverageComponentXmlTemplate);
Expand Down
6 changes: 3 additions & 3 deletions framework/src/source/CodeCoverage.brs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ function init()
end function

function setExpectedMap()
m.top.expectedMap = #EXPECTED_MAP#
m.top.expectedMap = "#EXPECTED_MAP#"
end function

function setFilePathMap()
m.top.filePathMap = #FILE_PATH_MAP#
m.top.filePathMap = "#FILE_PATH_MAP#"
end function

function onEntryChange()
entry = m.top.entry
entry = m.top.entry
if entry <> invalid
lineMap = m.resolvedMap[entry.f]

Expand Down
6 changes: 3 additions & 3 deletions framework/src/source/CodeCoverageSupport.brs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function RBS_ReportCodeCoverage() as void
resolvedCount = cc.resolvedMap[key].count()
allLinesHit += resolvedCount
resolvedPercent = (resolvedCount / expectedCount) * 100
hitFiles.push({percent:resolvedPercent, text:filename + ": " +str(resolvedPercent).trim() + "% (" + stri(resolvedCount).trim() + "/" + stri(expectedCount).trim() + ")"})
hitFiles.push({ percent: resolvedPercent, text: filename + ": " + str(resolvedPercent).trim() + "% (" + stri(resolvedCount).trim() + "/" + stri(expectedCount).trim() + ")" })
else
missFiles.push(filename + ": MISS!")
end if
Expand All @@ -41,13 +41,13 @@ function RBS_ReportCodeCoverage() as void
? "HIT FILES"
? "---------"
hitFiles.SortBy("percent")
for i = 0 to hitFiles.count() -1
for i = 0 to hitFiles.count() - 1
? hitFiles[i].text
end for
? ""
? "MISSED FILES"
? "------------"
for i = 0 to missFiles.count() -1
for i = 0 to missFiles.count() - 1
? missFiles[i]
end for

Expand Down
2 changes: 1 addition & 1 deletion framework/src/source/TestResult.bs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace rooibos
end if
end if
if m.throwOnFailedAssertion
throw m.getMessage()
throw m.getMessage()
end if
end function

Expand Down

0 comments on commit a3d843e

Please sign in to comment.