MCPcopy
hub / github.com/dreadl0ck/netcap / TestRegisterExtractor

Function TestRegisterExtractor

decoder/stream/file/framework_test.go:49–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestRegisterExtractor(t *testing.T) {
50 // Clear registry for testing
51 registry.extractors = make(map[string]FileExtractor)
52
53 mock := &MockFileExtractor{protocol: "TEST"}
54 RegisterExtractor(mock)
55
56 extractor, ok := GetExtractor("TEST")
57 if !ok {
58 t.Fatal("Failed to retrieve registered extractor")
59 }
60
61 if extractor.ProtocolName() != "TEST" {
62 t.Errorf("Protocol name = %s, want TEST", extractor.ProtocolName())
63 }
64}
65
66func TestGetExtractor_NotFound(t *testing.T) {
67 // Clear registry for testing

Callers

nothing calls this directly

Calls 3

RegisterExtractorFunction · 0.85
GetExtractorFunction · 0.85
ProtocolNameMethod · 0.65

Tested by

no test coverage detected