mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-05 22:31:11 +08:00
Add some tests
This commit is contained in:
parent
c4e6c7ac8c
commit
3121c43b14
20
test/fixtures/simple-lineplot-height-17.txt
vendored
Normal file
20
test/fixtures/simple-lineplot-height-17.txt
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
┌────────────────────────────────────────┐
|
||||
50 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⢸│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⡇│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡆⠀⠀⠀⠀⠀⠀⠀⡸⢸⠀⠀⠀⠀⠀⠀⠀⡇│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⢸⠀⠀⠀⠀⠀⠀⠀⡇⠸⡀⠀⠀⠀⠀⠀⢸⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⢣⠀⠀⠀⠀⠀⠀⠀⡇⠘⡄⠀⠀⠀⠀⠀⢰⠁⠀⡇⠀⠀⠀⠀⠀⡸⠀│
|
||||
│⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⡎⠘⡄⠀⠀⠀⠀⠀⢰⠁⠀⢇⠀⠀⠀⠀⠀⡸⠀⠀⢣⠀⠀⠀⠀⠀⡇⠀│
|
||||
│⠀⠀⢀⠜⠘⡄⠀⠀⠀⠀⠀⢸⠀⠀⢱⠀⠀⠀⠀⠀⡜⠀⠀⢸⠀⠀⠀⠀⠀⡇⠀⠀⢸⠀⠀⠀⠀⢀⠇⠀│
|
||||
│⠤⢤⠮⠤⠤⠼⡤⠤⠤⠤⢤⠧⠤⠤⠬⡦⠤⠤⠤⢤⠧⠤⠤⠬⡦⠤⠤⠤⢴⠥⠤⠤⠬⡦⠤⠤⠤⢼⠤⠤│
|
||||
│⡰⠁⠀⠀⠀⠀⠱⡀⠀⠀⡜⠀⠀⠀⠀⢱⠀⠀⠀⡸⠀⠀⠀⠀⢣⠀⠀⠀⡸⠀⠀⠀⠀⢇⠀⠀⠀⡸⠀⠀│
|
||||
│⠁⠀⠀⠀⠀⠀⠀⢣⠀⢰⠁⠀⠀⠀⠀⠈⡆⠀⢀⠇⠀⠀⠀⠀⠸⡀⠀⠀⡇⠀⠀⠀⠀⢸⠀⠀⠀⡇⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⢣⠇⠀⠀⠀⠀⠀⠀⢱⠀⢸⠀⠀⠀⠀⠀⠀⡇⠀⢰⠁⠀⠀⠀⠀⠘⡄⠀⢠⠃⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⡇⠀⠀⠀⠀⠀⠀⢱⠀⡸⠀⠀⠀⠀⠀⠀⡇⠀⢸⠀⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠀⠀⠘⡄⡇⠀⠀⠀⠀⠀⠀⢱⠀⡜⠀⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢷⠁⠀⠀⠀⠀⠀⠀⢸⠀⡇⠀⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠀⠀⠀⠀⣧⠃⠀⠀⠀│
|
||||
-50 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⠀⠀⠀⠀│
|
||||
└────────────────────────────────────────┘
|
||||
1 10
|
18
test/fixtures/simple-lineplot-margin-17.txt
vendored
Normal file
18
test/fixtures/simple-lineplot-margin-17.txt
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
┌────────────────────────────────────────┐
|
||||
50 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⡸│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⢇⠀⠀⠀⠀⠀⠀⠀⡇│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⢇⠀⠀⠀⠀⠀⠀⠀⡎⢸⠀⠀⠀⠀⠀⠀⢠⠃│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⡜⢸⠀⠀⠀⠀⠀⠀⢠⠃⠈⡆⠀⠀⠀⠀⠀⢸⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡸⠸⡀⠀⠀⠀⠀⠀⢠⠃⠀⡇⠀⠀⠀⠀⠀⢸⠀⠀⢇⠀⠀⠀⠀⠀⡎⠀│
|
||||
│⠀⠀⠀⡠⠳⡀⠀⠀⠀⠀⠀⢠⠃⠀⢣⠀⠀⠀⠀⠀⡜⠀⠀⢱⠀⠀⠀⠀⠀⡇⠀⠀⢸⠀⠀⠀⠀⠀⡇⠀│
|
||||
│⠤⢤⠼⠤⠤⠵⡤⠤⠤⠤⢤⠧⠤⠤⠼⡤⠤⠤⠤⢤⠧⠤⠤⠬⡦⠤⠤⠤⢴⠥⠤⠤⠬⡦⠤⠤⠤⢼⠤⠤│
|
||||
│⡠⠃⠀⠀⠀⠀⠱⡀⠀⠀⡜⠀⠀⠀⠀⢱⠀⠀⠀⡸⠀⠀⠀⠀⢣⠀⠀⠀⡸⠀⠀⠀⠀⡇⠀⠀⠀⡜⠀⠀│
|
||||
│⠁⠀⠀⠀⠀⠀⠀⠱⡀⡰⠁⠀⠀⠀⠀⠀⡇⠀⢀⠇⠀⠀⠀⠀⠸⡀⠀⠀⡇⠀⠀⠀⠀⢸⠀⠀⠀⡇⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠱⠃⠀⠀⠀⠀⠀⠀⠸⡀⡸⠀⠀⠀⠀⠀⠀⢇⠀⢸⠀⠀⠀⠀⠀⠘⡄⠀⢰⠁⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢇⠇⠀⠀⠀⠀⠀⠀⢸⠀⡎⠀⠀⠀⠀⠀⠀⡇⠀⢸⠀⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⣇⠇⠀⠀⠀⠀⠀⠀⢸⠀⡇⠀⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⠀⠀⠀⠀⠀⠀⠀⠘⣄⠇⠀⠀⠀│
|
||||
-50 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀│
|
||||
└────────────────────────────────────────┘
|
||||
1 10
|
18
test/fixtures/simple-lineplot-padding-17.txt
vendored
Normal file
18
test/fixtures/simple-lineplot-padding-17.txt
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
┌────────────────────────────────────────┐
|
||||
50 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⡸│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⢇⠀⠀⠀⠀⠀⠀⠀⡇│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⢇⠀⠀⠀⠀⠀⠀⠀⡎⢸⠀⠀⠀⠀⠀⠀⢠⠃│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⡜⢸⠀⠀⠀⠀⠀⠀⢠⠃⠈⡆⠀⠀⠀⠀⠀⢸⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡸⠸⡀⠀⠀⠀⠀⠀⢠⠃⠀⡇⠀⠀⠀⠀⠀⢸⠀⠀⢇⠀⠀⠀⠀⠀⡎⠀│
|
||||
│⠀⠀⠀⡠⠳⡀⠀⠀⠀⠀⠀⢠⠃⠀⢣⠀⠀⠀⠀⠀⡜⠀⠀⢱⠀⠀⠀⠀⠀⡇⠀⠀⢸⠀⠀⠀⠀⠀⡇⠀│
|
||||
│⠤⢤⠼⠤⠤⠵⡤⠤⠤⠤⢤⠧⠤⠤⠼⡤⠤⠤⠤⢤⠧⠤⠤⠬⡦⠤⠤⠤⢴⠥⠤⠤⠬⡦⠤⠤⠤⢼⠤⠤│
|
||||
│⡠⠃⠀⠀⠀⠀⠱⡀⠀⠀⡜⠀⠀⠀⠀⢱⠀⠀⠀⡸⠀⠀⠀⠀⢣⠀⠀⠀⡸⠀⠀⠀⠀⡇⠀⠀⠀⡜⠀⠀│
|
||||
│⠁⠀⠀⠀⠀⠀⠀⠱⡀⡰⠁⠀⠀⠀⠀⠀⡇⠀⢀⠇⠀⠀⠀⠀⠸⡀⠀⠀⡇⠀⠀⠀⠀⢸⠀⠀⠀⡇⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠱⠃⠀⠀⠀⠀⠀⠀⠸⡀⡸⠀⠀⠀⠀⠀⠀⢇⠀⢸⠀⠀⠀⠀⠀⠘⡄⠀⢰⠁⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢇⠇⠀⠀⠀⠀⠀⠀⢸⠀⡎⠀⠀⠀⠀⠀⠀⡇⠀⢸⠀⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⣇⠇⠀⠀⠀⠀⠀⠀⢸⠀⡇⠀⠀⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⠀⠀⠀⠀⠀⠀⠀⠘⣄⠇⠀⠀⠀│
|
||||
-50 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀│
|
||||
└────────────────────────────────────────┘
|
||||
1 10
|
18
test/fixtures/simple-lineplot-width-17.txt
vendored
Normal file
18
test/fixtures/simple-lineplot-width-17.txt
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
┌─────────────────┐
|
||||
50 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⠀⢸│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⢸│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⣧⠀⠀⢸⢣⠀⠀⢸│
|
||||
│⠀⠀⠀⠀⠀⢠⠀⠀⠀⣿⠀⠀⢸⢸⠀⠀⡇│
|
||||
│⠀⠀⠀⠀⠀⣾⠀⠀⢰⢹⠀⠀⢸⢸⠀⠀⡇│
|
||||
│⠀⡸⡄⠀⢀⠇⡇⠀⢸⠈⡆⠀⡎⢸⠀⠀⡇│
|
||||
│⢤⠧⢧⠤⢼⠤⡧⠤⡼⠤⡧⠤⡧⠬⡦⠤⡧│
|
||||
│⡎⠀⠸⡀⡎⠀⢸⠀⡇⠀⡇⠀⡇⠀⡇⢸⠀│
|
||||
│⠁⠀⠀⡇⡇⠀⢸⠀⡇⠀⢸⢠⠃⠀⡇⢸⠀│
|
||||
│⠀⠀⠀⠸⠀⠀⠀⣿⠀⠀⢸⢸⠀⠀⢇⢸⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠸⣸⠀⠀⢸⢸⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⡟⠀⠀⢸⡇⠀│
|
||||
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠇⠀⠀⢸⡇⠀│
|
||||
-50 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡇⠀│
|
||||
└─────────────────┘
|
||||
1 10
|
@ -153,8 +153,53 @@ class YouPlotSimpleTest < Test::Unit::TestCase
|
||||
assert_equal fixture('simple-lineplot-xlabel.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :line_x do
|
||||
YouPlot::Command.new(['line', '-x', 'X-LABEL']).run
|
||||
assert_equal fixture('simple-lineplot-xlabel.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :line_ylabel do
|
||||
YouPlot::Command.new(['line', '--ylabel', 'Y-LABEL']).run
|
||||
assert_equal fixture('simple-lineplot-ylabel.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :line_y do
|
||||
YouPlot::Command.new(['line', '-y', 'Y-LABEL']).run
|
||||
assert_equal fixture('simple-lineplot-ylabel.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :line_width do
|
||||
YouPlot::Command.new(['line', '--width', '17']).run
|
||||
assert_equal fixture('simple-lineplot-width-17.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :line_w do
|
||||
YouPlot::Command.new(['line', '--w', '17']).run
|
||||
assert_equal fixture('simple-lineplot-width-17.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :line_height do
|
||||
YouPlot::Command.new(['line', '--height', '17']).run
|
||||
assert_equal fixture('simple-lineplot-height-17.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :line_h do
|
||||
YouPlot::Command.new(['line', '--height', '17']).run
|
||||
assert_equal fixture('simple-lineplot-height-17.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :line_margin do
|
||||
YouPlot::Command.new(['line', '--margin', '17']).run
|
||||
assert_equal fixture('simple-lineplot-margin-17.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :line_m do
|
||||
YouPlot::Command.new(['line', '--m', '17']).run
|
||||
assert_equal fixture('simple-lineplot-margin-17.txt'), @stderr_file.read
|
||||
end
|
||||
|
||||
test :line_padding do
|
||||
YouPlot::Command.new(['line', '--padding', '17']).run
|
||||
assert_equal fixture('simple-lineplot-padding-17.txt'), @stderr_file.read
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user