From 4738b5ccd7bd3c97c16e592bbdbb6cf7da77a706 Mon Sep 17 00:00:00 2001 From: Nicholas Eden Date: Mon, 12 Nov 2018 19:07:40 -0800 Subject: [PATCH] fix bar graph test --- wtf_tests/bargraph/bargraph_test.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/wtf_tests/bargraph/bargraph_test.go b/wtf_tests/bargraph/bargraph_test.go index 02a383e9..79b87efa 100644 --- a/wtf_tests/bargraph/bargraph_test.go +++ b/wtf_tests/bargraph/bargraph_test.go @@ -8,17 +8,21 @@ import ( ) // MakeData - Create sample data -func makeData() [][2]int64 { +func makeData() []Bar { //this could come from config const lineCount = 2 - var stats [lineCount][2]int64 + var stats [lineCount]Bar - stats[0][1] = 1530122942000 - stats[0][0] = 100 + stats[0] = Bar{ + Label: "Jun 27, 2018", + Percent: 20, + } - stats[1][1] = 1531142942000 - stats[1][0] = 210 + stats[1] = Bar{ + Label: "Jul 09, 2018", + Percent: 80, + } return stats[:] @@ -29,5 +33,8 @@ func TestOutput(t *testing.T) { result := BuildStars(makeData(), 20, "*") - Equal(t, "Jun 27, 2018 -\t [red]*[white] - (100)\nJul 09, 2018 -\t [red]********************[white] - (210)\n", result) + Equal(t, + "Jun 27, 2018[[red]****[white] ] 20\nJul 09, 2018[[red]****************[white] ] 80\n", + result, + ) }