MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / assertOHLCEqual

Function assertOHLCEqual

examples/acceptance/ohlc-sample.ts:26–46  ·  view source on GitHub ↗
(
  label: string,
  actual: OHLCDataPoint,
  expected: { timestamp: number; open: number; close: number; low: number; high: number },
)

Source from the content-addressed store, hash-verified

24
25// Helper to compare OHLC values (works for both tuple and object)
26const assertOHLCEqual = (
27 label: string,
28 actual: OHLCDataPoint,
29 expected: { timestamp: number; open: number; close: number; low: number; high: number },
30): void => {
31 if (Array.isArray(actual)) {
32 // Tuple format: [timestamp, open, close, low, high]
33 assertEqual(`${label} timestamp`, actual[0], expected.timestamp);
34 assertEqual(`${label} open`, actual[1], expected.open);
35 assertEqual(`${label} close`, actual[2], expected.close);
36 assertEqual(`${label} low`, actual[3], expected.low);
37 assertEqual(`${label} high`, actual[4], expected.high);
38 } else {
39 // Object format
40 assertEqual(`${label} timestamp`, actual.timestamp, expected.timestamp);
41 assertEqual(`${label} open`, actual.open, expected.open);
42 assertEqual(`${label} close`, actual.close, expected.close);
43 assertEqual(`${label} low`, actual.low, expected.low);
44 assertEqual(`${label} high`, actual.high, expected.high);
45 }
46};
47
48// =============================================================================
49// 1. TUPLE INPUT TESTS

Callers 1

ohlc-sample.tsFile · 0.85

Calls 1

assertEqualFunction · 0.70

Tested by

no test coverage detected