- Rust engine: real bootstrap/wiring preflight (guardrail-agent), execution layer (retry/router/pre-trade/post-trade/reconciliation), guardrail-doctor diagnostics with allowlist-drift guard. - guardrail-cli: extracted pure helpers into util.rs (split in progress). - 6 Track-2 skills + ensemble; python-lab analytics (regime/drawdown/montecarlo/dossier/ensemble/journal/seed); clients (ts/py/go/mcp/langchain/web-lite/proof-verifier); alert relay; scenarios; helm/k8s/compose; docs. - dashboard/vercel.json + docs/VERCEL_DEPLOY.md for Vercel deployment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
33 lines
790 B
Rust
33 lines
790 B
Rust
//! Tests for the Money value type.
|
|
|
|
use common::money::Money;
|
|
use common::Decimal;
|
|
|
|
#[test]
|
|
fn usd_constructs_with_usd_currency() {
|
|
let m = Money::usd(Decimal::from(100));
|
|
assert_eq!(m.amount, Decimal::from(100));
|
|
assert_eq!(m.currency, "USD");
|
|
}
|
|
|
|
#[test]
|
|
fn zero_usd_is_zero_amount_in_usd() {
|
|
let m = Money::zero_usd();
|
|
assert_eq!(m.amount, Decimal::ZERO);
|
|
assert_eq!(m.currency, "USD");
|
|
}
|
|
|
|
#[test]
|
|
fn display_renders_amount_and_currency() {
|
|
let m = Money::usd(Decimal::new(1250, 2)); // 12.50
|
|
assert_eq!(m.to_string(), "12.50 USD");
|
|
}
|
|
|
|
#[test]
|
|
fn money_serde_round_trip() {
|
|
let m = Money::usd(Decimal::from(42));
|
|
let json = serde_json::to_string(&m).unwrap();
|
|
let back: Money = serde_json::from_str(&json).unwrap();
|
|
assert_eq!(back, m);
|
|
}
|