Files
Mike Cohenanddependabot[bot] 5708c27dd6 Refactor code to satisfy static checks (#4826)
Also sync upstream vfilter fixes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-15 13:43:08 +10:00

22 lines
425 B
Go

package utils
import (
"testing"
"www.velocidex.com/golang/velociraptor/vtesting/assert"
)
func TestExtractHuntId(t *testing.T) {
hunt_id := "H.123"
flow_id := CreateFlowIdFromHuntId(hunt_id)
assert.Equal(t, "F.123.H", flow_id)
extracted_hunt_id, ok := ExtractHuntId(flow_id)
assert.True(t, ok)
assert.Equal(t, extracted_hunt_id, hunt_id)
// Regular flow
_, ok = ExtractHuntId("F.1234")
assert.True(t, !ok)
}