-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Rename from gawk to gchalk to prevent name confusion with G…
…NU Awk.
- Loading branch information
Showing
18 changed files
with
198 additions
and
198 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package gawk | ||
package gchalk | ||
|
||
//go:generate stringer -type=ColorLevel | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,45 +1,45 @@ | ||
package gawk | ||
package gchalk | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
var benchGawk = New(ForceLevel(LevelAnsi16m)) | ||
var benchGChalk = New(ForceLevel(LevelAnsi16m)) | ||
|
||
func BenchmarkColor(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
benchGawk.Red("Hello world!") | ||
benchGChalk.Red("Hello world!") | ||
} | ||
} | ||
|
||
func BenchmarkRgb(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
benchGawk.RGB(10, 30, 255)("Hello world!") | ||
benchGChalk.RGB(10, 30, 255)("Hello world!") | ||
} | ||
} | ||
|
||
func BenchmarkColorNoSetup(b *testing.B) { | ||
benchGawk.Red("Hello world!") | ||
benchGChalk.Red("Hello world!") | ||
b.ResetTimer() | ||
for i := 0; i < b.N; i++ { | ||
benchGawk.Red("Hello world!") | ||
benchGChalk.Red("Hello world!") | ||
} | ||
} | ||
|
||
func BenchmarkComposed(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
benchGawk.WithBgBlue().WithBold().Red("Hello world!") | ||
benchGChalk.WithBgBlue().WithBold().Red("Hello world!") | ||
} | ||
} | ||
|
||
func BenchmarkNested(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
benchGawk.Red("Hello", benchGawk.Green("green"), "world!") | ||
benchGChalk.Red("Hello", benchGChalk.Green("green"), "world!") | ||
} | ||
} | ||
|
||
func BenchmarkStyle(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
benchGawk.StyleMust("red")("Hello world!") | ||
benchGChalk.StyleMust("red")("Hello world!") | ||
} | ||
} |
Oops, something went wrong.