File: feat-value_py.test

package info (click to toggle)
ledger 3.1.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,464 kB
  • sloc: cpp: 37,495; python: 4,279; perl: 1,319; sh: 475; lisp: 436; makefile: 134; cs: 118; yacc: 103
file content (23 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
python
    def print_type(val):
        print type(val), val

eval print_type(true)
eval print_type([2010/08/10])
eval print_type(10)
eval print_type($10.00)
eval print_type($10.00 + CAD 30)
eval print_type("Hello!")
eval print_type(/Hello!/)
;eval print_type((1, 2, 3))

test reg
<type 'bool'> True
<type 'datetime.date'> 2010-08-10
<class 'ledger.Amount'> 10
<class 'ledger.Amount'> $10.00
<class 'ledger.Balance'> $10.00
CAD 30
<type 'unicode'> Hello!
<class 'ledger.Value'> Hello!
end test