Skip to content

Commit 537da80

Browse files
authored
Add test for Unitify log message (#264)
* Add test for 'Unitify' log message * Fix 'Indicator' test
1 parent fd7e109 commit 537da80

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/transforms/unitify.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function _unitify(name)
2626
try
2727
uparse(unitstr)
2828
catch
29-
@warn "the unit \"$unitstr\" is not valid"
29+
@warn "The unit \"$unitstr\" is not valid"
3030
NoUnits
3131
end
3232
else

test/transforms/indicator.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

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

test/transforms/unitify.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# invalid unit name
3838
t = Table(; Symbol("a [test]") => rand(10))
3939
T = Unitify()
40-
n, c = apply(T, t)
40+
n, c = @test_logs (:warn, "The unit \"test\" is not valid") apply(T, t)
4141
@test Tables.schema(n).names == (:a,)
4242
@test unit(eltype(n.a)) === NoUnits
4343
tₒ = revert(T, n, c)

0 commit comments

Comments
 (0)