Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 79 lines (55 sloc) 1.291 kb
d3f7833 @benburkert Add simple roundup tests.
benburkert authored
1 #!/usr/bin/env roundup
2
3 describe "spark: Generates sparklines for a set of data."
4
5 spark="./spark"
6
bf1e66a @holman Test for help on empty argv
authored
7 it_shows_help_with_no_argv() {
8 $spark | grep USAGE
9 }
10
d3f7833 @benburkert Add simple roundup tests.
benburkert authored
11 it_graphs_argv_data() {
12 graph="$($spark 1,5,22,13,5)"
13
986b7fe @holman update tests
authored
14 test $graph = '▁▂█▅▂'
d3f7833 @benburkert Add simple roundup tests.
benburkert authored
15 }
16
17 it_charts_pipe_data() {
18 data="0,30,55,80,33,150"
19 graph="$(echo $data | $spark)"
20
986b7fe @holman update tests
authored
21 test $graph = '▁▂▃▄▂█'
d3f7833 @benburkert Add simple roundup tests.
benburkert authored
22 }
a2f142b @holman (failing) test for decimals
authored
23
76095a2 @holman add space tests
authored
24 it_charts_spaced_data() {
25 data="0 30 55 80 33 150"
26 graph="$($spark $data)"
27
986b7fe @holman update tests
authored
28 test $graph = '▁▂▃▄▂█'
76095a2 @holman add space tests
authored
29 }
30
31 it_charts_way_spaced_data() {
32 data="0 30 55 80 33 150"
33 graph="$($spark $data)"
34
986b7fe @holman update tests
authored
35 test $graph = '▁▂▃▄▂█'
76095a2 @holman add space tests
authored
36 }
37
a2f142b @holman (failing) test for decimals
authored
38 it_handles_decimals() {
39 data="5.5,20"
40 graph="$($spark $data)"
41
986b7fe @holman update tests
authored
42 test $graph = '▁█'
a2f142b @holman (failing) test for decimals
authored
43 }
cb12dd6 @joshmoore Odd results from boundary cases
joshmoore authored
44
45 it_charts_100_lt_300() {
46 data="1,2,3,4,100,5,10,20,50,300"
47 graph="$($spark $data)"
48
631e282 @holman fix tests that #40 broke
authored
49 test $graph = '▁▁▁▁▃▁▁▁▂█'
cb12dd6 @joshmoore Odd results from boundary cases
joshmoore authored
50 }
51
52 it_charts_50_lt_100() {
53 data="1,50,100"
54 graph="$($spark $data)"
55
986b7fe @holman update tests
authored
56 test $graph = '▁▄█'
cb12dd6 @joshmoore Odd results from boundary cases
joshmoore authored
57 }
58
59 it_charts_4_lt_8() {
60 data="2,4,8"
61 graph="$($spark $data)"
62
986b7fe @holman update tests
authored
63 test $graph = '▁▃█'
cb12dd6 @joshmoore Odd results from boundary cases
joshmoore authored
64 }
551b81b @joshmoore All ticks the same for 1-5
joshmoore authored
65
66 it_charts_no_tier_0() {
67 data="1,2,3,4,5"
68 graph="$($spark $data)"
69
986b7fe @holman update tests
authored
70 test $graph = '▁▂▄▆█'
551b81b @joshmoore All ticks the same for 1-5
joshmoore authored
71 }
b04f4f2 @holman Add tests for #73
authored
72
73 it_equalizes_at_midtier_on_same_data() {
74 data="1,1,1,1"
75 graph="$($spark $data)"
76
77 test $graph = '▅▅▅▅'
78 }
Something went wrong with that request. Please try again.