Skip to content

Commit d238947

Browse files
kshyattandyferris
authored andcommitted
Fix typos, more tests (#184)
1 parent ae438dc commit d238947

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/SMatrix.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ macro SMatrix(ex)
125125
end
126126
ex = ex.args[1]
127127
if length(ex.args) != 3
128-
error("Use a 2-dimensional comprehension for @SMatrx")
128+
error("Use a 2-dimensional comprehension for @SMatrix")
129129
end
130130

131131
rng1 = eval(current_module(), ex.args[2].args[2])
@@ -145,7 +145,7 @@ macro SMatrix(ex)
145145
T = ex.args[1]
146146
ex = ex.args[2]
147147
if length(ex.args) != 3
148-
error("Use a 2-dimensional comprehension for @SMatrx")
148+
error("Use a 2-dimensional comprehension for @SMatrix")
149149
end
150150

151151
rng1 = eval(current_module(), ex.args[2].args[2])

test/SMatrix.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@
3737

3838
@test ((@SMatrix [i*j for i = 1:2, j=2:3])::SMatrix{2,2}).data === (2, 4, 3, 6)
3939
@test ((@SMatrix Float64[i*j for i = 1:2, j=2:3])::SMatrix{2,2}).data === (2.0, 4.0, 3.0, 6.0)
40-
4140
@test (ex = macroexpand(:(@SMatrix [1 2; 3])); isa(ex, Expr) && ex.head == :error)
41+
@test (ex = macroexpand(:(@SMatrix [i*j*k for i = 1:2, j=2:3, k=3:4])); isa(ex, Expr) && ex.head == :error)
42+
@test (ex = macroexpand(:(@SMatrix Float64[i*j*k for i = 1:2, j=2:3, k=3:4])); isa(ex, Expr) && ex.head == :error)
43+
@test (ex = macroexpand(:(@SMatrix fill(1.5, 2, 3, 4))); isa(ex, Expr) && ex.head == :error)
4244

4345
@test ((@SMatrix zeros(2,2))::SMatrix{2, 2, Float64}).data === (0.0, 0.0, 0.0, 0.0)
4446
@test ((@SMatrix ones(2,2))::SMatrix{2, 2, Float64}).data === (1.0, 1.0, 1.0, 1.0)

0 commit comments

Comments
 (0)