file addition: arbitrary (d--r------)
file addition: metadata.rs (----------)
file addition: metadata (d--r------)
file addition: snapshots (d--r------)
file addition: arbitrary__metadata__link__arbitrary_link.snap (----------)
+ ---
+ source: beancount/types/tests/arbitrary/metadata/link.rs
+ expression: "Link::arbitrary(&mut u)"
+ ---
+ Ok(
+ Link {
+ name: "^TRJ0JW3QTSLFSIRNQIQ3WFSITR",
+ },
+ )
file addition: arbitrary__metadata__kv__arbitrary_values.snap (----------)
+ ---
+ 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",
+ ),
+ ),
+ ]
file addition: arbitrary__metadata__kv__arbitrary_key.snap (----------)
+ ---
+ source: beancount/types/tests/arbitrary/metadata/kv.rs
+ expression: "MetadataKey::arbitrary(&mut u)"
+ ---
+ Ok(
+ Key {
+ name: "lTL2LY5SVUNHUKTPSKS5YHUKVT",
+ },
+ )
file addition: link.rs (----------)
+ 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));
+ }
file addition: kv.rs (----------)
+ 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<_>>());
+ }
file addition: main.rs (----------)
+ mod core;
+ mod directive;
+ mod metadata;
file addition: directive.rs (----------)
+ mod balance;
+ mod close;
+ mod open;
+ mod price;
+ mod transaction;
file addition: directive (d--r------)
file addition: transaction.rs (----------)
+ 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));
+ }
file addition: snapshots (d--r------)
file addition: arbitrary__directive__transaction__arbitrary_transaction.snap (----------)
+ ---
+ 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: [],
+ },
+ )
file addition: arbitrary__directive__transaction__arbitrary_posting.snap (----------)
+ ---
+ 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: {},
+ },
+ )
file addition: arbitrary__directive__price__arbitrary_price.snap (----------)
+ ---
+ 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: {},
+ },
+ )
file addition: arbitrary__directive__open__arbitrary_open.snap (----------)
+ ---
+ 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: {},
+ },
+ )
file addition: arbitrary__directive__close__arbitrary_close.snap (----------)
+ ---
+ 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,
+ ),
+ },
+ },
+ )
file addition: arbitrary__directive__balance__arbitrary_balance.snap (----------)
+ ---
+ 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,
+ ),
+ },
+ },
+ )
file addition: price.rs (----------)
+ 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));
+ }
file addition: open.rs (----------)
+ 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));
+ }
file addition: close.rs (----------)
+ 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));
+ }
file addition: balance.rs (----------)
+ 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));
+ }
file addition: core.rs (----------)
+ mod account;
+ mod amount;
+ mod commodity;
+ mod cost;
+ mod price;
file addition: core (d--r------)
file addition: snapshots (d--r------)
file addition: arbitrary__core__price__arbitrary_price.snap (----------)
+ ---
+ source: beancount/types/tests/arbitrary/core/price.rs
+ expression: "PriceSpec::arbitrary(&mut u)"
+ ---
+ Ok(
+ PerUnit(
+ Amount {
+ amount: -3385527990958838316430120690.2,
+ commodity: Commodity {
+ name: "TGWHFBGINMAAAAAAAAA",
+ },
+ },
+ ),
+ )
file addition: arbitrary__core__cost__arbitrary_cost_spec.snap (----------)
+ ---
+ 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,
+ },
+ )
file addition: arbitrary__core__cost__arbitrary_cost_basis.snap (----------)
+ ---
+ source: beancount/types/tests/arbitrary/core/cost.rs
+ expression: "CostBasis::arbitrary(&mut u)"
+ ---
+ Ok(
+ PerUnit(
+ Amount {
+ amount: -3385527990958838316430120690.2,
+ commodity: Commodity {
+ name: "TGWHFBGINMAAAAAAAAA",
+ },
+ },
+ ),
+ )
file addition: arbitrary__core__commodity__arbitrary_commodity.snap (----------)
+ ---
+ source: beancount/types/tests/arbitrary/core/commodity.rs
+ expression: "Commodity::arbitrary(&mut u)"
+ ---
+ Ok(
+ Commodity {
+ name: "HFXOXKREHGZTGWFBEWER",
+ },
+ )
file addition: arbitrary__core__amount__arbitrary_amount.snap (----------)
+ ---
+ source: beancount/types/tests/arbitrary/core/amount.rs
+ expression: "Amount::arbitrary(&mut u)"
+ ---
+ Ok(
+ Amount {
+ amount: -32.010464035435278364236935027,
+ commodity: Commodity {
+ name: "WERKTGWHFBGIN",
+ },
+ },
+ )
file addition: arbitrary__core__account__arbitrary_segment.snap (----------)
+ ---
+ source: beancount/types/tests/arbitrary/core/account.rs
+ expression: "Segment::arbitrary(&mut u)"
+ ---
+ Ok(
+ Segment {
+ inner: "Hkcp8lbmkglnsrAAAAAAAA",
+ },
+ )
file addition: arbitrary__core__account__arbitrary_account.snap (----------)
+ ---
+ source: beancount/types/tests/arbitrary/core/account.rs
+ expression: "Account::arbitrary(&mut u)"
+ ---
+ Ok(
+ Account {
+ name: "Assets:Btcpwjmle8lb:7bjwp8lbmkglnsrAAAA",
+ },
+ )
file addition: price.rs (----------)
+ 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));
+ }
file addition: cost.rs (----------)
+ 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));
+ }
file addition: commodity.rs (----------)
+ 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));
+ }
file addition: amount.rs (----------)
+ 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));
+ }
file addition: account.rs (----------)
+ 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));
+ }