mirror of
https://github.com/Velocidex/velociraptor.git
synced 2026-10-12 02:09:59 +00:00
Also sync upstream vfilter fixes --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
22 lines
425 B
Go
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)
|
|
}
|