-
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b7a4ed
commit 9d37b99
Showing
27 changed files
with
338 additions
and
1,826 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,10 @@ | ||
package pterm_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/MarvinJWendt/testza" | ||
"github.com/pterm/pterm" | ||
"testing" | ||
) | ||
|
||
func TestBar_WithLabel(t *testing.T) { | ||
p := pterm.Bar{} | ||
s := "X" | ||
p2 := p.WithLabel(s) | ||
|
||
testza.AssertEqual(t, s, p2.Label) | ||
testza.AssertZero(t, p.Label) | ||
} | ||
|
||
func TestBar_WithStyle(t *testing.T) { | ||
p := pterm.Bar{} | ||
s := pterm.NewStyle(pterm.FgRed, pterm.BgBlue, pterm.Bold) | ||
p2 := p.WithStyle(s) | ||
|
||
testza.AssertEqual(t, s, p2.Style) | ||
testza.AssertZero(t, p.Style) | ||
} | ||
|
||
func TestBar_WithValue(t *testing.T) { | ||
p := pterm.Bar{} | ||
s := 1337 | ||
p2 := p.WithValue(s) | ||
|
||
testza.AssertEqual(t, s, p2.Value) | ||
testza.AssertZero(t, p.Value) | ||
} | ||
|
||
func TestBar_WithLabelStyle(t *testing.T) { | ||
p := pterm.Bar{} | ||
s := pterm.NewStyle(pterm.FgRed, pterm.BgBlue, pterm.Bold) | ||
p2 := p.WithLabelStyle(s) | ||
|
||
testza.AssertEqual(t, s, p2.LabelStyle) | ||
testza.AssertZero(t, p.LabelStyle) | ||
func TestBar_WithMethods(t *testing.T) { | ||
testWithMethods(t, pterm.Bar{}) | ||
} |
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
Oops, something went wrong.