Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
guptarohit committed Jul 3, 2018
1 parent 9447d46 commit 3b6b80d
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion asciigraph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,41 @@ func TestPlot(t *testing.T) {
-9.00 ┼ ╰╯ ╰╯ `},
{
[]float64{-0.000018527, -0.021, -.00123, .00000021312, -.0434321234, -.032413241234, .0000234234},
[]Option{Height(5),Width(45)},
[]Option{Height(5), Width(45)},
` 0.000 ┼─╮ ╭────────╮ ╭
-0.008 ┤ ╰──╮ ╭──╯ ╰─╮ ╭─╯
-0.017 ┤ ╰─────╯ ╰╮ ╭─╯
-0.025 ┤ ╰─╮ ╭─╯
-0.034 ┤ ╰╮ ╭────╯
-0.042 ┼ ╰───╯ `},
{
[]float64{57.76, 54.04, 56.31, 57.02, 59.5, 52.63, 52.97, 56.44, 56.75, 52.96, 55.54, 55.09, 58.22, 56.85, 60.61, 59.62, 59.73, 59.93, 56.3, 54.69, 55.32, 54.03, 50.98, 50.48, 54.55, 47.49, 55.3, 46.74, 46, 45.8, 49.6, 48.83, 47.64, 46.61, 54.72, 42.77, 50.3, 42.79, 41.84, 44.19, 43.36, 45.62, 45.09, 44.95, 50.36, 47.21, 47.77, 52.04, 47.46, 44.19, 47.22, 45.55, 40.65, 39.64, 37.26, 40.71, 42.15, 36.45, 39.14, 36.62},
[]Option{Width(-10), Height(-10), Offset(-1)},
` 60.61 ┤ ╭╮ ╭╮
59.60 ┤ ╭╮ │╰─╯│
58.60 ┤ ││ ╭╮│ │
57.59 ┼╮ ╭╯│ │││ │
56.58 ┤│╭╯ │ ╭─╮ │╰╯ ╰╮
55.58 ┤││ │ │ │╭─╯ │╭╮ ╭╮
54.57 ┤╰╯ │ │ ││ ╰╯╰╮ ╭╮││ ╭╮
53.56 ┤ │╭╯ ╰╯ │ ││││ ││
52.56 ┤ ╰╯ │ ││││ ││ ╭╮
51.55 ┤ ╰╮││││ ││ ││
50.54 ┤ ╰╯│││ ││╭╮ ╭╮ ││
49.54 ┤ │││ ╭─╮ ││││ ││ ││
48.53 ┤ │││ │ │ ││││ ││ ││
47.52 ┤ ╰╯│ │ ╰╮││││ │╰─╯╰╮╭╮
46.52 ┤ ╰─╮│ ╰╯│││ │ │││
45.51 ┤ ╰╯ │││ ╭──╯ ││╰╮
44.50 ┤ │││ ╭╮│ ╰╯ │
43.50 ┤ ││╰╮│╰╯ │
42.49 ┤ ╰╯ ╰╯ │ ╭╮
41.48 ┤ │ ││
40.48 ┤ ╰╮ ╭╯│
39.47 ┤ ╰╮│ │╭╮
38.46 ┤ ││ │││
37.46 ┤ ╰╯ │││
36.45 ┤ ╰╯╰ `},
}

for i := range cases {
Expand Down

0 comments on commit 3b6b80d

Please sign in to comment.