Skip to content

Commit b4a211f

Browse files
committed
Add tests
1 parent d737252 commit b4a211f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

spec/reference_spec.cr

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def spy_fixture_matrix(key : String) : Array(Array(Float64))
5757
cols_a = entry["cols"].as_a.map(&.as_i)
5858
vals_a = entry["vals"].as_a.map(&.as_f)
5959
matrix = Array.new(nrows) { Array.new(ncols, 0.0) }
60-
rows_a.each_with_index do |r, idx|
61-
matrix[r - 1][cols_a[idx] - 1] = vals_a[idx]
60+
rows_a.each_with_index do |row, idx|
61+
matrix[row - 1][cols_a[idx] - 1] = vals_a[idx]
6262
end
6363
matrix
6464
end
@@ -872,6 +872,12 @@ describe "Julia reference output compatibility" do
872872
test_ref("heatmap/default_5x0.txt", p)
873873
end
874874

875+
it "matches heatmap/default_10x0" do
876+
z = Array.new(10) { [] of Float64 }
877+
p = UnicodePlot.heatmap(z, labels: false)
878+
test_ref("heatmap/default_10x0.txt", p)
879+
end
880+
875881
# integers_20x20: repeat(collect(1:20), outer=(1,20)) → A[i,j] = i
876882
it "matches heatmap/integers_20x20" do
877883
z = Array.new(20) { |i| Array.new(20) { |_j| (i + 1).to_f } }

0 commit comments

Comments
 (0)