Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
Ice3man543 committed Jun 20, 2024
1 parent 46b5462 commit 4ca4b49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion patterns.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ func evaluateVersionExpression(expression string, submatches []string) (string,
if len(parts) != 2 {
return "", fmt.Errorf("invalid ternary expression: %s", expression)
}
fmt.Printf("Parts: %+v\n", parts)

trueFalseParts := strings.Split(parts[1], ":")
if len(trueFalseParts) != 2 {
Expand Down
12 changes: 9 additions & 3 deletions wappalyzergo_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package wappalyzer

import (
"fmt"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -14,8 +13,6 @@ func TestCookiesDetect(t *testing.T) {
matches := wappalyzer.Fingerprint(map[string][]string{
"Set-Cookie": {"_uetsid=ABCDEF"},
}, []byte(""))

fmt.Printf("%v\n", matches)
require.Contains(t, matches, "Microsoft Advertising", "Could not get correct match")

t.Run("position", func(t *testing.T) {
Expand Down Expand Up @@ -90,6 +87,15 @@ func TestUniqueFingerprints(t *testing.T) {
fingerprints.SetIfNotExists("another", "2.3.5", 100)
require.Equal(t, map[string]struct{}{"test": {}, "new:2.3.5": {}, "another:2.3.5": {}}, fingerprints.GetValues(), "could not get correct values")
})

t.Run("confidence", func(t *testing.T) {
f := NewUniqueFingerprints()
f.SetIfNotExists("test", "", 0)
require.Equal(t, map[string]struct{}{}, f.GetValues(), "could not get correct values")

f.SetIfNotExists("test", "2.36.4", 100)
require.Equal(t, map[string]struct{}{"test:2.36.4": {}}, f.GetValues(), "could not get correct values")
})
}

func Test_FingerprintWithInfo(t *testing.T) {
Expand Down

0 comments on commit 4ca4b49

Please sign in to comment.