@@ -24,45 +24,39 @@ defmodule Asciinema.SvgRasterTest do
2424 assert rgb_at ( decoded , 8 , 12 ) == { 4 , 5 , 6 }
2525 end
2626
27- test "renders representative glyphs grouped by rasterized groups" do
27+ test "renders representative glyphs supported by rasterized groups" do
2828 fg = { 240 , 16 , 32 }
2929 bg = { 1 , 2 , 3 }
3030
31- # 0: █, 1: │ , 2: ┃ , 3: ╵ , 4: ╷, 5: ╹, 6: ╻, 7: ■, 8 : 🬀
31+ # 0: █, 1: ┃ , 2: ╹ , 3: ╻ , 4: ■, 5 : 🬀
3232 mosaic_blocks = [
3333 { 0 , 0 , 0x2588 , fg } ,
34- { 0 , 1 , 0x2502 , fg } ,
35- { 0 , 2 , 0x2503 , fg } ,
36- { 0 , 3 , 0x2575 , fg } ,
37- { 0 , 4 , 0x2577 , fg } ,
38- { 0 , 5 , 0x2579 , fg } ,
39- { 0 , 6 , 0x257B , fg } ,
40- { 0 , 7 , 0x25A0 , fg } ,
41- { 0 , 8 , 0x1FB00 , fg }
34+ { 0 , 1 , 0x2503 , fg } ,
35+ { 0 , 2 , 0x2579 , fg } ,
36+ { 0 , 3 , 0x257B , fg } ,
37+ { 0 , 4 , 0x25A0 , fg } ,
38+ { 0 , 5 , 0x1FB00 , fg }
4239 ]
4340
44- png = SvgRaster . render_png ( 9 , 1 , bg , [ ] , mosaic_blocks )
41+ png = SvgRaster . render_png ( 6 , 1 , bg , [ ] , mosaic_blocks )
4542 decoded = decode_png ( png )
4643
4744 # block elements
4845 assert cell_contains_color? ( decoded , 0 , 0 , fg )
4946
50- # box verticals
47+ # heavy box verticals
5148 assert cell_contains_color? ( decoded , 1 , 0 , fg )
5249 assert cell_contains_color? ( decoded , 2 , 0 , fg )
5350 assert cell_contains_color? ( decoded , 3 , 0 , fg )
54- assert cell_contains_color? ( decoded , 4 , 0 , fg )
55- assert cell_contains_color? ( decoded , 5 , 0 , fg )
56- assert cell_contains_color? ( decoded , 6 , 0 , fg )
5751
5852 # black square
59- assert cell_contains_color? ( decoded , 7 , 0 , fg )
53+ assert cell_contains_color? ( decoded , 4 , 0 , fg )
6054
6155 # sextants
62- assert cell_contains_color? ( decoded , 8 , 0 , fg )
56+ assert cell_contains_color? ( decoded , 5 , 0 , fg )
6357 end
6458
65- test "renders box drawing vertical lines with light/heavy widths " do
59+ test "renders heavy box drawing vertical lines on raster layer " do
6660 png =
6761 SvgRaster . render_png (
6862 2 ,
@@ -74,17 +68,13 @@ defmodule Asciinema.SvgRasterTest do
7468
7569 decoded = decode_png ( png )
7670
77- # light line: x + 4, width 1
78- assert rgb_at ( decoded , 4 , 12 ) == { 240 , 16 , 32 }
79- assert rgb_at ( decoded , 3 , 12 ) == { 1 , 2 , 3 }
80-
8171 # heavy line: x + 3, width 2
8272 assert rgb_at ( decoded , 11 , 12 ) == { 240 , 16 , 32 }
8373 assert rgb_at ( decoded , 12 , 12 ) == { 240 , 16 , 32 }
8474 assert rgb_at ( decoded , 10 , 12 ) == { 1 , 2 , 3 }
8575 end
8676
87- test "renders box drawing vertical half-lines with direction and light/heavy widths " do
77+ test "renders heavy box drawing vertical half-lines on raster layer " do
8878 png =
8979 SvgRaster . render_png (
9080 4 ,
@@ -101,16 +91,6 @@ defmodule Asciinema.SvgRasterTest do
10191
10292 decoded = decode_png ( png )
10393
104- # light up (top half only)
105- assert rgb_at ( decoded , 4 , 5 ) == { 240 , 16 , 32 }
106- assert rgb_at ( decoded , 4 , 18 ) == { 1 , 2 , 3 }
107- assert rgb_at ( decoded , 3 , 5 ) == { 1 , 2 , 3 }
108-
109- # light down (bottom half only)
110- assert rgb_at ( decoded , 12 , 5 ) == { 1 , 2 , 3 }
111- assert rgb_at ( decoded , 12 , 18 ) == { 240 , 16 , 32 }
112- assert rgb_at ( decoded , 11 , 18 ) == { 1 , 2 , 3 }
113-
11494 # heavy up (top half only)
11595 assert rgb_at ( decoded , 19 , 5 ) == { 240 , 16 , 32 }
11696 assert rgb_at ( decoded , 20 , 5 ) == { 240 , 16 , 32 }
0 commit comments