MCPcopy Create free account
hub / github.com/Open-Quant/openquant / test_input_exceptions

Function test_input_exceptions

crates/openquant/tests/etf_trick.rs:110–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108
109#[test]
110fn test_input_exceptions() {
111 let modified_open = {
112 let mut t = table("open_df.csv");
113 t.index.push("2020-01-01".to_string());
114 t.values.push(vec![4.0; t.columns.len()]);
115 t
116 };
117
118 let result = EtfTrick::from_tables(
119 modified_open,
120 table("close_df.csv"),
121 table("alloc_df.csv"),
122 table("costs_df.csv"),
123 None,
124 );
125 assert!(result.is_err());
126
127 let open_path = fixture_path("open_df.csv");
128 let close_path = fixture_path("close_df.csv");
129 let alloc_path = fixture_path("alloc_df.csv");
130 let costs_path = fixture_path("costs_df.csv");
131 let csv_etf_trick =
132 EtfTrick::from_csv(&open_path, &close_path, &alloc_path, &costs_path, None).unwrap();
133 assert!(csv_etf_trick.get_etf_series(2).is_err());
134}
135
136/// The numbers printed on docs-site/src/content/docs/modules/etf-trick.md. The docs gate only
137/// compiles Rust examples, so the output shown there is pinned here instead.

Callers

nothing calls this directly

Calls 2

tableFunction · 0.85
fixture_pathFunction · 0.85

Tested by

no test coverage detected