Skip to content

Commit

Permalink
Adds test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
djschleen authored Aug 14, 2024
1 parent 6dcbe71 commit 55cd61f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/util_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package lib

import (
"regexp"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -173,3 +174,12 @@ func Test_MarkdownToHTML(t *testing.T) {
assert.NotNil(t, results)
assert.Equal(t, "<h2>test</h2>\n", results.Packages[0].Vulnerabilities[0].Description)
}

func TestGenerateFilename(t *testing.T) {
filename := GenerateFilename()

pattern := `^\d{8}-\d{2}-\d{2}-\d{2}-bomber-results\.html$`

assert.NotEqual(t, "", filename)
assert.Regexp(t, regexp.MustCompile(pattern), filename)
}

0 comments on commit 55cd61f

Please sign in to comment.