MCPcopy Create free account
hub / github.com/facebook/time / TestGenerateSVGDataPath

Function TestGenerateSVGDataPath

caliper/caliper_test.go:596–618  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

594}
595
596func TestGenerateSVGDataPath(t *testing.T) {
597 tor := buildTestTOR()
598 peaks, err := DetectPeaks(tor, 0)
599 require.NoError(t, err)
600
601 result, err := ComputeResult(tor, peaks, "test", "PF000001", GNSSoF16RxE, Gen2Phase2, 0, 0)
602 require.NoError(t, err)
603
604 var buf bytes.Buffer
605 err = GenerateSVG(tor, peaks, result, &buf)
606 require.NoError(t, err)
607
608 svg := buf.String()
609 // Verify the trace path element exists
610 require.Contains(t, svg, `<path d="M`)
611 require.Contains(t, svg, `stroke="#2563eb"`)
612 // Verify axis labels
613 require.Contains(t, svg, "Time (ns)")
614 require.Contains(t, svg, "Amplitude (dB)")
615 // Verify info block
616 require.Contains(t, svg, "Resolution:")
617 require.Contains(t, svg, "Refractive Index:")
618}

Callers

nothing calls this directly

Calls 5

buildTestTORFunction · 0.85
DetectPeaksFunction · 0.85
ComputeResultFunction · 0.85
GenerateSVGFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…