source: tags/1.6.0/t/format-dollar.lisp

Last change on this file was 15151, checked in by Mark Evenson, 4 years ago

Merge pull request #110 from easye/easye/test-format-dollar

Easye/test format dollar

File size: 1.0 KB
Line 
1;;; tests for FORMAT wackiness <https://abcl.org/trac/ticket/190>
2
3(prove:plan 15)
4
5(prove:ok
6 (format t "~,vf" 3 -0.1768522)
7 "reported with -0.177 NIL")
8
9(prove:ok
10 (format t "~,vf" 2 -0.1768522)
11 "reported with -0.18 NIL")
12
13(prove:ok 
14 (format t "~,vf" 1 -0.1768522)
15 "reported with -0.2 NIL")
16
17(prove:ok 
18 (format t "~,vf" 0 -0.1768522)
19 "-0. NIL")
20
21(prove:ok 
22 (format t "~$" -0.1768522)
23 "--1.6 NIL")
24
25(prove:ok
26 (format t "~v$" 3 -0.1768522)
27 "reported as --1.75 NIL")
28
29(prove:ok
30 (format t "~v$" 2 -0.1768522)
31 "--1.6 NIL")
32
33(prove:ok
34 (format t "~v$" 1 -0.1768522)
35 "reported type error:  Array index out of bounds: 2")
36
37(prove:ok
38 (format t "~v$" 0 -0.1768522)
39 "--0. NIL")
40
41(prove:ok 
42 (format t "~$" 0.1768522)
43 "0.18 NIL")
44
45(prove:ok 
46 (format t "~v$" 3 0.1768522)
47 "0.177 NIL")
48
49(prove:ok
50 (format nil "~v$" 2 0.1768522)
51 "0.18 NIL")
52
53(prove:ok 
54 (format nil "~v$" 1 0.1768522)
55 "0.2 NIL")
56
57(prove:ok
58 (format nil "~v$" 0 0.1768522)
59 "0. NIL")
60
61;; dingd
62(prove:ok
63 (format nil "~$" -0.0)
64 "-0.00")
65
66(prove:finalize)
Note: See TracBrowser for help on using the repository browser.