Skip to content

Commit 53a8e83

Browse files
authored
Merge pull request #12 from Konstantin8105/master
redesign test, add godoc bange
2 parents fa4feb4 + 9d34cc4 commit 53a8e83

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ![GoTree](https://rawgit.com/DiSiqueira/GoTree/master/gotree-logo.png)
22

3-
# GoTree ![Language Badge](https://img.shields.io/badge/Language-Go-blue.svg) ![Go Report](https://goreportcard.com/badge/github.com/DiSiqueira/GoTree) ![License Badge](https://img.shields.io/badge/License-MIT-blue.svg) ![Status Badge](https://img.shields.io/badge/Status-Beta-brightgreen.svg)
3+
# GoTree ![Language Badge](https://img.shields.io/badge/Language-Go-blue.svg) ![Go Report](https://goreportcard.com/badge/github.com/DiSiqueira/GoTree) ![License Badge](https://img.shields.io/badge/License-MIT-blue.svg) ![Status Badge](https://img.shields.io/badge/Status-Beta-brightgreen.svg) [![GoDoc](https://godoc.org/github.com/DiSiqueira/GoTree?status.svg)](https://godoc.org/github.com/DiSiqueira/GoTree)
44

55
Simple Go module to print tree structures in terminal. Heavily inpired by [The Tree Command for Linux][treecommand]
66

gotree_test.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
package gotree_test
22

33
import (
4-
"testing"
4+
"fmt"
55

66
gotree "github.com/DiSiqueira/GoTree"
77
)
88

9-
func TestLast(t *testing.T) {
10-
want := `Pantera
11-
├── Far Beyond Driven
12-
│ └── 5 minutes Alone
13-
└── Power Metal
14-
`
15-
9+
func ExampleTree() {
1610
artist := gotree.New("Pantera")
1711
album := artist.Add("Far Beyond Driven")
1812
album.Add("5 minutes Alone")
1913
artist.Add("Power Metal")
14+
fmt.Println(artist.Print())
2015

21-
got := artist.Print()
22-
if got != want {
23-
t.Errorf("Expected: \n%s\n", want)
24-
t.Errorf("Got: \n%s\n", got)
25-
}
16+
// Output:
17+
// Pantera
18+
// ├── Far Beyond Driven
19+
// │ └── 5 minutes Alone
20+
// └── Power Metal
2621
}

0 commit comments

Comments
 (0)