File tree Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -5593,3 +5593,72 @@ func TestVirtualSendCreditAround(t *testing.T) {
5593
5593
}
5594
5594
test (t , tc )
5595
5595
}
5596
+
5597
+ func TestVirtualKept (t * testing.T ) {
5598
+ script := `
5599
+ vars {
5600
+ account $v1 = virtual()
5601
+ }
5602
+
5603
+ send [USD 1] (
5604
+ source = @v1
5605
+ destination = $v1
5606
+ )
5607
+
5608
+ send [USD 2] (
5609
+ source = $v2
5610
+ destination = @dest
5611
+ )
5612
+
5613
+ send [USD 1] (
5614
+ // that's why this doesn't output any postings
5615
+ source = @world
5616
+ destination = $v2
5617
+ )
5618
+ `
5619
+
5620
+ tc := NewTestCase ()
5621
+ tc .compile (t , script )
5622
+
5623
+ tc .expected = CaseResult {
5624
+ Postings : []machine.Posting {},
5625
+ }
5626
+ test (t , tc )
5627
+ }
5628
+
5629
+ func TestVirtualSendCreditAroundMixed (t * testing.T ) {
5630
+ t .Skip ("TODO impl test" )
5631
+
5632
+ script := `
5633
+ vars {
5634
+ account $v1 = virtual()
5635
+ account $v2 = virtual()
5636
+ }
5637
+
5638
+ send [USD 1] (
5639
+ source = $v1 allowing unbounded overdraft
5640
+ destination = $v2
5641
+ )
5642
+
5643
+ send [USD 2] (
5644
+ // here's we're sending the credit we have from $v1
5645
+ // so $v2 doesn't "owe" anything to @dest
5646
+ source = $v2
5647
+ destination = @dest
5648
+ )
5649
+
5650
+ send [USD 1] (
5651
+ // that's why this doesn't output any postings
5652
+ source = @world
5653
+ destination = $v2
5654
+ )
5655
+ `
5656
+
5657
+ tc := NewTestCase ()
5658
+ tc .compile (t , script )
5659
+
5660
+ tc .expected = CaseResult {
5661
+ Postings : []machine.Posting {},
5662
+ }
5663
+ test (t , tc )
5664
+ }
You can’t perform that action at this time.
0 commit comments