| 1 | package core |
| 2 | |
| 3 | import ( |
| 4 | "regexp" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | func TestBannerName(t *testing.T) { |
| 9 | if Name != "bettercap" { |
| 10 | t.Fatalf("expected '%s', got '%s'", "bettercap", Name) |
| 11 | } |
| 12 | } |
| 13 | func TestBannerWebsite(t *testing.T) { |
| 14 | if Website != "https://bettercap.org/" { |
| 15 | t.Fatalf("expected '%s', got '%s'", "https://bettercap.org/", Website) |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | func TestBannerVersion(t *testing.T) { |
| 20 | match, err := regexp.MatchString(`\d+.\d+`, Version) |
| 21 | if err != nil { |
| 22 | t.Fatalf("unable to perform regex on Version constant") |
| 23 | } |
| 24 | if !match { |
| 25 | t.Fatalf("expected Version constant in format '%s', got '%s'", "X.X", Version) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func TestBannerAuthor(t *testing.T) { |
| 30 | if Author != "Simone 'evilsocket' Margaritelli" { |
| 31 | t.Fatalf("expected '%s', got '%s'", "Simone 'evilsocket' Margaritelli", Author) |
| 32 | } |
| 33 | } |