mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
Harden scan robustness and tests
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
//go:build plugin_postgresql || !plugin_selective
|
||||
|
||||
package services
|
||||
|
||||
import (
|
||||
@@ -21,3 +23,10 @@ func TestPostgreSQLConnStringEscapesIPv6AndCredentials(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestPostgreSQLVulnInfoTruncatesByRune(t *testing.T) {
|
||||
got := truncateRunes(strings.Repeat("界", 105), 100)
|
||||
if len([]rune(got)) != 103 || !strings.HasSuffix(got, "...") {
|
||||
t.Fatalf("postgresql truncation helper = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user