Skip to content

Commit e82fd30

Browse files
committed
Add density canvas test
1 parent 348ed2e commit e82fd30

6 files changed

Lines changed: 53 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
▒░  ░         ░   ░  ░   ░  ░      ░ ▒▒▓
2+
▒ ░░               ░        ░    ▒▒▒▒  
3+
▒ ░ ░░   ░ ▒ ▒      ▒    ░   ▒▒▒▒   ░  
4+
▒   ░░▒▒░▒░░░░░░░░░░░░░░░▒▒▒▒░░░▒░░░░░ 
5+
▒░ ░    ░▒           ▒▒▒▒   ░   ░░  ░  
6+
▒   ▒    ░░░   ░ ▒▒▒▒ ░       ░   ░░░  
7+
▒      ░    ░▒▒▒▒   ░      ░     ░     ░
8+
▒ ░ ░    ▒▒▒▒ ░░    ░        ░░        
9+
▒  ▒ ▒▒▒▒      ░░░   ░░         ░░    ░
10+
█▒▒▒▒  ░          ░░░  ▒░░        ░ ░  
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
▒░ ░ ░ ░ ░ ░ ░ ░ ▒▒▓
2+
▒ ░░ ░ ░ ▒▒▒▒
3+
▒ ░ ░░ ░ ▒ ▒ ▒ ░ ▒▒▒▒ ░
4+
▒ ░░▒▒░▒░░░░░░░░░░░░░░░▒▒▒▒░░░▒░░░░░
5+
▒░ ░ ░▒ ▒▒▒▒ ░ ░░ ░
6+
▒ ▒ ░░░ ░ ▒▒▒▒ ░ ░ ░░░
7+
▒ ░ ░▒▒▒▒ ░ ░ ░ ░
8+
▒ ░ ░ ▒▒▒▒ ░░ ░ ░░
9+
▒ ▒ ▒▒▒▒ ░░░ ░░ ░░ ░
10+
█▒▒▒▒ ░ ░░░ ▒░░ ░ ░
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
▒ ░ ░░   ░ ▒ ▒      ▒    ░   ▒▒▒▒   ░  
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
┌────────────────────────────────────────┐
2+
│▒░  ░         ░   ░  ░   ░  ░      ░ ▒▒▓│
3+
│▒ ░░               ░        ░    ▒▒▒▒   │
4+
│▒ ░ ░░   ░ ▒ ▒      ▒    ░   ▒▒▒▒   ░   │
5+
│▒   ░░▒▒░▒░░░░░░░░░░░░░░░▒▒▒▒░░░▒░░░░░  │
6+
│▒░ ░    ░▒           ▒▒▒▒   ░   ░░  ░   │
7+
│▒   ▒    ░░░   ░ ▒▒▒▒ ░       ░   ░░░   │
8+
│▒      ░    ░▒▒▒▒   ░      ░     ░     ░│
9+
│▒ ░ ░    ▒▒▒▒ ░░    ░        ░░         │
10+
│▒  ▒ ▒▒▒▒      ░░░   ░░         ░░    ░ │
11+
│█▒▒▒▒  ░          ░░░  ▒░░        ░ ░   │
12+
└────────────────────────────────────────┘
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
┌────────────────────────────────────────┐
2+
│▒░ ░ ░ ░ ░ ░ ░ ░ ▒▒▓│
3+
│▒ ░░ ░ ░ ▒▒▒▒ │
4+
│▒ ░ ░░ ░ ▒ ▒ ▒ ░ ▒▒▒▒ ░ │
5+
│▒ ░░▒▒░▒░░░░░░░░░░░░░░░▒▒▒▒░░░▒░░░░░ │
6+
│▒░ ░ ░▒ ▒▒▒▒ ░ ░░ ░ │
7+
│▒ ▒ ░░░ ░ ▒▒▒▒ ░ ░ ░░░ │
8+
│▒ ░ ░▒▒▒▒ ░ ░ ░ ░│
9+
│▒ ░ ░ ▒▒▒▒ ░░ ░ ░░ │
10+
│▒ ▒ ▒▒▒▒ ░░░ ░░ ░░ ░ │
11+
│█▒▒▒▒ ░ ░░░ ▒░░ ░ ░ │
12+
└────────────────────────────────────────┘

test/test-canvas.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module CanvasTestCases
44

55
CANVAS_CLASSES = {
66
ascii: UnicodePlot::AsciiCanvas,
7-
braille: UnicodePlot::BrailleCanvas
7+
braille: UnicodePlot::BrailleCanvas,
8+
density: UnicodePlot::DensityCanvas
89
}.freeze
910

1011
def self.included(mod)
@@ -122,3 +123,9 @@ class AsciiCanvasTest < Test::Unit::TestCase
122123

123124
include CanvasTestCases
124125
end
126+
127+
class DensityCanvasTest < Test::Unit::TestCase
128+
CANVAS_NAME = :density
129+
130+
include CanvasTestCases
131+
end

0 commit comments

Comments
 (0)