-
-
Notifications
You must be signed in to change notification settings - Fork 813
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into gcal-format
- Loading branch information
Showing
5 changed files
with
53 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package bargraphtests | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/senorprogrammer/wtf/wtf" | ||
. "github.com/stretchr/testify/assert" | ||
) | ||
|
||
// MakeData - Create sample data | ||
func makeData() [][2]int64 { | ||
|
||
//this could come from config | ||
const lineCount = 2 | ||
var stats [lineCount][2]int64 | ||
|
||
stats[0][1] = 1530122942 | ||
stats[0][0] = 100 | ||
|
||
stats[1][1] = 1530132942 | ||
stats[1][0] = 210 | ||
|
||
return stats[:] | ||
|
||
} | ||
|
||
//TestOutput of the bargraph make string (BuildStars) function | ||
func TestOutput(t *testing.T) { | ||
|
||
result := BuildStars(makeData(), 20, "*") | ||
|
||
Equal(t, result, "Jan 18, 1970 -\t [red]*[white] - (100)\nJan 18, 1970 -\t [red]********************[white] - (210)\n") | ||
} |