mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
add simple core banner constants test
This commit adds a simple test to core for the banner constants. Mainly a test to get started with building out more tests. Yeah, I know it’s silly.
This commit is contained in:
parent
480f0daa8d
commit
274fd945b3
1 changed files with 36 additions and 0 deletions
36
core/banner_test.go
Normal file
36
core/banner_test.go
Normal file
|
@ -0,0 +1,36 @@
|
|||
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)
|
||||
}
|
||||
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