mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-12-05 02:10:18 +01:00
cb6e5cb0c7
* use dep for vendoring * lets encrypt * moved web to transfer.sh-web repo * single command install * added first tests
27 lines
692 B
Go
27 lines
692 B
Go
package internal
|
|
|
|
import "testing"
|
|
|
|
func TestLookupCommandInfo(t *testing.T) {
|
|
for _, n := range []string{"watch", "WATCH", "wAtch"} {
|
|
if LookupCommandInfo(n) == (CommandInfo{}) {
|
|
t.Errorf("LookupCommandInfo(%q) = CommandInfo{}, expected non-zero value", n)
|
|
}
|
|
}
|
|
}
|
|
|
|
func benchmarkLookupCommandInfo(b *testing.B, names ...string) {
|
|
for i := 0; i < b.N; i++ {
|
|
for _, c := range names {
|
|
LookupCommandInfo(c)
|
|
}
|
|
}
|
|
}
|
|
|
|
func BenchmarkLookupCommandInfoCorrectCase(b *testing.B) {
|
|
benchmarkLookupCommandInfo(b, "watch", "WATCH", "monitor", "MONITOR")
|
|
}
|
|
|
|
func BenchmarkLookupCommandInfoMixedCase(b *testing.B) {
|
|
benchmarkLookupCommandInfo(b, "wAtch", "WeTCH", "monItor", "MONiTOR")
|
|
}
|