diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77160ac..832f278 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -77,7 +77,7 @@ jobs: # all tests passed. fail: false - name: Attach the report - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 if: always() with: name: ${{ steps.xunit-viewer.outputs.report-name }} diff --git a/CHANGELOG.md b/CHANGELOG.md index c534552..dd6a4c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.0.4] - Unreleased + +### Fixed +- #54: Defend against possible configuration-dependent SQL exceptions in mapping INT to MAC/CLS coverage + ## [4.0.3] - 2024-08-19 ### Fixed diff --git a/cls/TestCoverage/Procedures.cls b/cls/TestCoverage/Procedures.cls index 85542f3..b05c2ba 100644 --- a/cls/TestCoverage/Procedures.cls +++ b/cls/TestCoverage/Procedures.cls @@ -82,7 +82,9 @@ ClassMethod ListToBit(pSource As %List) As %Binary [ SqlName = LIST_TO_BIT, SqlP Set tResult = "" Set tPointer = 0 While $ListNext(pSource,tPointer,tBitPosition) { - Set $Bit(tResult,tBitPosition) = 1 + If $Data(tBitPosition)#2 && (+tBitPosition > 0) { + Set $Bit(tResult,+tBitPosition) = 1 + } } Quit tResult } diff --git a/internal/testing/unit_tests/UnitTest/TestCoverage/Unit/Procedures.cls b/internal/testing/unit_tests/UnitTest/TestCoverage/Unit/Procedures.cls new file mode 100644 index 0000000..a001405 --- /dev/null +++ b/internal/testing/unit_tests/UnitTest/TestCoverage/Unit/Procedures.cls @@ -0,0 +1,13 @@ +Class UnitTest.TestCoverage.Unit.Procedures Extends %UnitTest.TestCase +{ + +Method TestListToBit() +{ + Set compare = "" + For i=1:1:3 { + Set $Bit(compare,i) = 1 + } + Do $$$AssertEquals(##class(TestCoverage.Procedures).ListToBit($lb(1,2,3,,"")),compare) +} + +} \ No newline at end of file diff --git a/module.xml b/module.xml index 4cf105b..5e6d731 100644 --- a/module.xml +++ b/module.xml @@ -2,7 +2,7 @@ TestCoverage - 4.0.3 + 4.0.4 Run your typical ObjectScript %UnitTest tests and see which lines of your code are executed. Includes Cobertura-style reporting for use in continuous integration tools. module