mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
Merge pull request #248 from picatz/test-core-banner
add simple core banner constants test
This commit is contained in:
commit
0bf981ba3b
1 changed files with 33 additions and 0 deletions
33
core/banner_test.go
Normal file
33
core/banner_test.go
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
package core
|
||||||
|
|
||||||
|
import (
|
||||||
|
"regexp"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestBannerName(t *testing.T) {
|
||||||
|
if Name != "bettercap" {
|
||||||
|
t.Fatalf("expected '%s', got '%s'", "bettercap", Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func TestBannerWebsite(t *testing.T) {
|
||||||
|
if Website != "https://bettercap.org/" {
|
||||||
|
t.Fatalf("expected '%s', got '%s'", "https://bettercap.org/", Website)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestBannerVersion(t *testing.T) {
|
||||||
|
match, err := regexp.MatchString(`\d+.\d+`, Version)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unable to perform regex on Version constant")
|
||||||
|
}
|
||||||
|
if !match {
|
||||||
|
t.Fatalf("expected Version constant in format '%s', got '%s'", "X.X", Version)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestBannerAuthor(t *testing.T) {
|
||||||
|
if Author != "Simone 'evilsocket' Margaritelli" {
|
||||||
|
t.Fatalf("expected '%s', got '%s'", "Simone 'evilsocket' Margaritelli", Author)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue