ibapi 1.2.2

A Rust implementation of the Interactive Brokers TWS API, providing a reliable and user friendly interface for TWS and IB Gateway. Designed with a focus on simplicity and performance.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use pretty_assertions::assert_eq;

use super::*;

#[test]
fn message_version_for() {
    assert_eq!(super::message_version_for(server_versions::NOT_HELD), 45);
    assert_eq!(super::message_version_for(server_versions::EXECUTION_DATA_CHAIN), 27);
}

#[test]
fn f64_max_to_zero() {
    assert_eq!(super::f64_max_to_zero(Some(f64::MAX)), Some(0.0));
    assert_eq!(super::f64_max_to_zero(Some(0.0)), Some(0.0));
    assert_eq!(super::f64_max_to_zero(Some(50.0)), Some(50.0));
}