YCLR274IMOMCNYGBRTQMEYP2YFM6BADNJK2WU37LJCJ23L7J7ASAC
mod kv;
mod link;
---
source: beancount/types/tests/arbitrary/metadata/link.rs
expression: "Link::arbitrary(&mut u)"
---
Ok(
Link {
name: "^TRJ0JW3QTSLFSIRNQIQ3WFSITR",
},
)
---
source: beancount/types/tests/arbitrary/metadata/kv.rs
expression: "INPUTS.iter().map(|&input|\n {\n let mut u = Unstructured::new(input);\n MetadataValue::arbitrary(&mut u)\n }).collect::<Vec<_>>()"
---
[
Ok(
Date(
-1172-04-30,
),
),
Ok(
Number(
-3386853110931577195.0859317102,
),
),
Ok(
String(
"random",
),
),
]
---
source: beancount/types/tests/arbitrary/metadata/kv.rs
expression: "MetadataKey::arbitrary(&mut u)"
---
Ok(
Key {
name: "lTL2LY5SVUNHUKTPSKS5YHUKVT",
},
)
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::Link;
#[test]
fn arbitrary_link() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(Link::arbitrary(&mut u));
}
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::MetadataKey;
use beancount_types::MetadataValue;
#[test]
fn arbitrary_key() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(MetadataKey::arbitrary(&mut u));
}
#[test]
fn arbitrary_values() {
const INPUTS: &[&[u8]] = &[b"\0123", b"anotherrandominput", b"\x02randominput"];
insta::assert_debug_snapshot!(INPUTS
.iter()
.map(|&input| {
let mut u = Unstructured::new(input);
MetadataValue::arbitrary(&mut u)
})
.collect::<Vec<_>>());
}
mod core;
mod directive;
mod metadata;
mod balance;
mod close;
mod open;
mod price;
mod transaction;
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::Posting;
use beancount_types::Transaction;
#[test]
fn arbitrary_posting() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(Posting::arbitrary(&mut u));
}
#[test]
fn arbitrary_transaction() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(Transaction::arbitrary(&mut u));
}
---
source: beancount/types/tests/arbitrary/directive/transaction.rs
expression: "Transaction::arbitrary(&mut u)"
---
Ok(
Transaction {
date: -9286-09-22,
flag: Complete,
payee: Some(
"longandmildlyrandomi",
),
narration: None,
links: {},
meta: {
Key {
name: "aa",
}: Date(
-9999-01-01,
),
},
postings: [],
},
)
---
source: beancount/types/tests/arbitrary/directive/transaction.rs
expression: "Posting::arbitrary(&mut u)"
---
Ok(
Posting {
flag: Some(
Complete,
),
account: Account {
name: "Equity",
},
amount: Some(
Amount {
amount: -33545785603037554613364354924,
commodity: Commodity {
name: "FBGINMAAAAAAAAAA",
},
},
),
cost: None,
price: None,
meta: {},
},
)
---
source: beancount/types/tests/arbitrary/directive/price.rs
expression: "Price::arbitrary(&mut u)"
---
Ok(
Price {
date: -9286-09-22,
quote: Commodity {
name: "OXKREH",
},
price: Amount {
amount: -35428083011873160.564169598830,
commodity: Commodity {
name: "GINMAAAAAA",
},
},
meta: {},
},
)
---
source: beancount/types/tests/arbitrary/directive/open.rs
expression: "Open::arbitrary(&mut u)"
---
Ok(
Open {
date: -9286-09-22,
account: Account {
name: "Equity",
},
commodities: {
Commodity {
name: "GINMAAAAAA",
},
Commodity {
name: "REHGZTGWFBEWERKTGWH",
},
},
booking: None,
meta: {},
},
)
---
source: beancount/types/tests/arbitrary/directive/close.rs
expression: "Close::arbitrary(&mut u)"
---
Ok(
Close {
date: -9286-09-22,
account: Account {
name: "Equity",
},
meta: {
Key {
name: "kSVUNHU",
}: Number(
-3386853110931577967.7437847917,
),
},
},
)
---
source: beancount/types/tests/arbitrary/directive/balance.rs
expression: "Balance::arbitrary(&mut u)"
---
Ok(
Balance {
date: -9286-09-22,
account: Account {
name: "Equity",
},
amount: Amount {
amount: 3262817.3218388061837837562469,
commodity: Commodity {
name: "GW",
},
},
meta: {
Key {
name: "fUW10aaaaaaaaaaaaaaa",
}: Date(
-9999-01-01,
),
},
},
)
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::Price;
#[test]
fn arbitrary_price() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(Price::arbitrary(&mut u));
}
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::Open;
#[test]
fn arbitrary_open() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(Open::arbitrary(&mut u));
}
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::Close;
#[test]
fn arbitrary_close() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(Close::arbitrary(&mut u));
}
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::Balance;
#[test]
fn arbitrary_balance() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(Balance::arbitrary(&mut u));
}
mod account;
mod amount;
mod commodity;
mod cost;
mod price;
---
source: beancount/types/tests/arbitrary/core/price.rs
expression: "PriceSpec::arbitrary(&mut u)"
---
Ok(
PerUnit(
Amount {
amount: -3385527990958838316430120690.2,
commodity: Commodity {
name: "TGWHFBGINMAAAAAAAAA",
},
},
),
)
---
source: beancount/types/tests/arbitrary/core/cost.rs
expression: "CostSpec::arbitrary(&mut u)"
---
Ok(
Spec {
basis: PerUnit(
Amount {
amount: -3385527990958838316430120690.2,
commodity: Commodity {
name: "TGWHFBGINMAAAAAAAAA",
},
},
),
date: None,
label: None,
},
)
---
source: beancount/types/tests/arbitrary/core/cost.rs
expression: "CostBasis::arbitrary(&mut u)"
---
Ok(
PerUnit(
Amount {
amount: -3385527990958838316430120690.2,
commodity: Commodity {
name: "TGWHFBGINMAAAAAAAAA",
},
},
),
)
---
source: beancount/types/tests/arbitrary/core/commodity.rs
expression: "Commodity::arbitrary(&mut u)"
---
Ok(
Commodity {
name: "HFXOXKREHGZTGWFBEWER",
},
)
---
source: beancount/types/tests/arbitrary/core/amount.rs
expression: "Amount::arbitrary(&mut u)"
---
Ok(
Amount {
amount: -32.010464035435278364236935027,
commodity: Commodity {
name: "WERKTGWHFBGIN",
},
},
)
---
source: beancount/types/tests/arbitrary/core/account.rs
expression: "Segment::arbitrary(&mut u)"
---
Ok(
Segment {
inner: "Hkcp8lbmkglnsrAAAAAAAA",
},
)
---
source: beancount/types/tests/arbitrary/core/account.rs
expression: "Account::arbitrary(&mut u)"
---
Ok(
Account {
name: "Assets:Btcpwjmle8lb:7bjwp8lbmkglnsrAAAA",
},
)
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::PriceSpec;
#[test]
fn arbitrary_price() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(PriceSpec::arbitrary(&mut u));
}
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::CostBasis;
use beancount_types::CostSpec;
#[test]
fn arbitrary_cost_basis() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(CostBasis::arbitrary(&mut u));
}
#[test]
fn arbitrary_cost_spec() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(CostSpec::arbitrary(&mut u));
}
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::Commodity;
#[test]
fn arbitrary_commodity() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(Commodity::arbitrary(&mut u));
}
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::Amount;
#[test]
fn arbitrary_amount() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(Amount::arbitrary(&mut u));
}
use arbitrary::Arbitrary;
use arbitrary::Unstructured;
use beancount_types::Account;
use beancount_types::Segment;
#[test]
fn arbitrary_account() {
let mut u = Unstructured::new(b"someverylongandmildlyrandominput");
insta::assert_debug_snapshot!(Account::arbitrary(&mut u));
}
#[test]
fn arbitrary_segment() {
let mut u = Unstructured::new(b"somerandominput");
insta::assert_debug_snapshot!(Segment::arbitrary(&mut u));
}