-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cue
142 lines (133 loc) · 2.72 KB
/
test.cue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package test
import (
"github.com/tmm1/taxes/fixtures"
"github.com/tmm1/taxes/freefile"
"github.com/tmm1/taxes/testing"
"github.com/tmm1/taxes/worksheets"
"github.com/tmm1/taxes"
)
(testing.#T & {
focus: {
suite: string @tag(suite)
test: string @tag(test)
}
test: "Return.filingStatus": {
subject: taxes.#validateReturnData
"0": assert: ok: {
filingStatus: "single"
}
"1": assert: notOk: {
filingStatus: "marriedFilingJointly"
}
"2": assert: ok: {
filingStatus: "marriedFilingJointly"
taxPayer: {
spouse: {
}
}
}
}
test: "#convert.date": {
subject: taxes.#convert.date
"0": assert: {
invoke: "2012-12-25"
out: "12/25/2012"
}
}
test: "#convert.filingStatus": {
subject: taxes.#convert.filingStatus
let t = {
in: _ //freefile.#Return
out: in.f1040.chkFilingStatus
}
"0": assert: {
transform: t
invoke: "single"
out: "single"
}
"1": assert: {
transform: t
invoke: "marriedFilingJointly"
out: "joint"
}
"2": assert: {
transform: t
invoke: "marriedFilingSeparately"
out: "separate"
}
}
test: "#convert.taxPayer": {
subject: taxes.#convert.taxPayer
"0": assert: {
invoke: fixtures.taxPayer.morganGardner
out: f1040: {
txtSSN: "400-00-1037"
txtFirstName: "Morgan"
}
}
"1": assert: {
invoke: fixtures.taxPayer.samGardenia
out: f1040: chkSpBlind: "1"
}
}
test: "#convert.ReturnData": {
subject: taxes.#convert.ReturnData
let sam = taxes.#ReturnData & {
taxYear: "2021"
taxPayer: fixtures.taxPayer.samGardenia
filingStatus: "marriedFilingJointly"
}
"0": assert: {
invoke: sam
out: freefile.#Return
out: f1040: {
chkFilingStatus: "joint"
chkSpBlind: "1"
txtDepSSN1: "400-00-1070"
cboDepRelation1: "SO"
}
}
"1": assert: {
invoke: sam & {
w2s: [fixtures.w2.saksFifth]
}
out: freefile.#Return
out: f1040: {
txtWagesSalariesTips: "28921"
}
}
}
test: "#TaxYear.#computeTax": {
subject: taxes.#TaxYear.#computeTax
"0": assert: {
invoke: {
taxYear: "2021"
filingStatus: "single"
income: 5K
}
out: 500
}
}
test: "worksheets.qualifiedDividendsAndCapitalGainTax": {
subject: worksheets.#qualifiedDividendsAndCapitalGainTax
"0": assert: {
invoke: {
f1040: taxes.#Form1040 & {
taxYear: "2021"
filingStatus: "marriedFilingJointly"
ordinaryDividends: 200K
qualifiedDividends: 200K
}
computeTax: {
in: number
out: (taxes.#TaxYear.#computeTax & {"in": {
taxYear: f1040.taxYear
filingStatus: f1040.filingStatus
income: in
}}).out
}
}
out: 14115
}
}
}).results