Skip to content

Commit

Permalink
Add test for Unitify log message (#264)
Browse files Browse the repository at this point in the history
* Add test for 'Unitify' log message

* Fix 'Indicator' test
  • Loading branch information
eliascarv authored Dec 29, 2023
1 parent fd7e109 commit 537da80
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/transforms/unitify.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function _unitify(name)
try
uparse(unitstr)
catch
@warn "the unit \"$unitstr\" is not valid"
@warn "The unit \"$unitstr\" is not valid"
NoUnits
end
else
Expand Down
2 changes: 1 addition & 1 deletion test/transforms/indicator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

a = [5.8, 6.4, 6.4, 9.8, 7.6, 8.2, 4.5, 2.5, 1.7, 2.3]
b = [8.4, 1.4, 7.2, 1.8, 9.4, 1.0, 2.0, 5.2, 9.4, 6.2]
c = [4.1, 5.6, 7.1, 9.1, 5.9, 9.5, 5.7, 9.0, 6.6, 9.9]
c = [4.1, 5.6, 7.1, 9.1, 5.9, 9.5, 5.7, 9.2, 6.6, 9.9]
d = [7.5, 2.2, 1.6, 2.8, 1.2, 1.5, 3.7, 2.0, 8.3, 8.2]
t = Table(; a, b, c, d)

Expand Down
2 changes: 1 addition & 1 deletion test/transforms/unitify.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# invalid unit name
t = Table(; Symbol("a [test]") => rand(10))
T = Unitify()
n, c = apply(T, t)
n, c = @test_logs (:warn, "The unit \"test\" is not valid") apply(T, t)
@test Tables.schema(n).names == (:a,)
@test unit(eltype(n.a)) === NoUnits
tₒ = revert(T, n, c)
Expand Down

0 comments on commit 537da80

Please sign in to comment.