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 @@ -5666,3 +5666,72 @@ func TestVirtualSendCreditAround(t *testing.T) {
5666
5666
}
5667
5667
test (t , tc )
5668
5668
}
5669
+
5670
+ func TestVirtualKept (t * testing.T ) {
5671
+ script := `
5672
+ vars {
5673
+ account $v1 = virtual()
5674
+ }
5675
+
5676
+ send [USD 1] (
5677
+ source = @v1
5678
+ destination = $v1
5679
+ )
5680
+
5681
+ send [USD 2] (
5682
+ source = $v2
5683
+ destination = @dest
5684
+ )
5685
+
5686
+ send [USD 1] (
5687
+ // that's why this doesn't output any postings
5688
+ source = @world
5689
+ destination = $v2
5690
+ )
5691
+ `
5692
+
5693
+ tc := NewTestCase ()
5694
+ tc .compile (t , script )
5695
+
5696
+ tc .expected = CaseResult {
5697
+ Postings : []machine.Posting {},
5698
+ }
5699
+ test (t , tc )
5700
+ }
5701
+
5702
+ func TestVirtualSendCreditAroundMixed (t * testing.T ) {
5703
+ t .Skip ("TODO impl test" )
5704
+
5705
+ script := `
5706
+ vars {
5707
+ account $v1 = virtual()
5708
+ account $v2 = virtual()
5709
+ }
5710
+
5711
+ send [USD 1] (
5712
+ source = $v1 allowing unbounded overdraft
5713
+ destination = $v2
5714
+ )
5715
+
5716
+ send [USD 2] (
5717
+ // here's we're sending the credit we have from $v1
5718
+ // so $v2 doesn't "owe" anything to @dest
5719
+ source = $v2
5720
+ destination = @dest
5721
+ )
5722
+
5723
+ send [USD 1] (
5724
+ // that's why this doesn't output any postings
5725
+ source = @world
5726
+ destination = $v2
5727
+ )
5728
+ `
5729
+
5730
+ tc := NewTestCase ()
5731
+ tc .compile (t , script )
5732
+
5733
+ tc .expected = CaseResult {
5734
+ Postings : []machine.Posting {},
5735
+ }
5736
+ test (t , tc )
5737
+ }
You can’t perform that action at this time.
0 commit comments