File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class OutputSpec: QuickSpec
51
51
( p, " output " ) <~ calculator. outputSignal
52
52
}
53
53
54
- describe ( " accumulate digits " ) {
54
+ describe ( " accumulate number " ) {
55
55
56
56
context ( " digits " ) {
57
57
@@ -102,6 +102,33 @@ class OutputSpec: QuickSpec
102
102
}
103
103
104
104
}
105
+
106
+ context ( " decimal point + zero " ) {
107
+
108
+ it ( " `0 . 0` should print `0.0` " ) {
109
+
110
+ p. input = " 0 "
111
+ expect ( p. output!) . to ( equal ( " 0 " ) )
112
+
113
+ p. input = " . "
114
+ expect ( p. output!) . to ( equal ( " 0. " ) )
115
+
116
+ p. input = " 0 "
117
+ expect ( p. output!) . to ( equal ( " 0.0 " ) )
118
+
119
+ }
120
+
121
+ it ( " `. 0` should print `0.0` " ) {
122
+
123
+ p. input = " . "
124
+ expect ( p. output!) . to ( equal ( " 0. " ) ) // "0" should be prepended
125
+
126
+ p. input = " 0 "
127
+ expect ( p. output!) . to ( equal ( " 0.0 " ) )
128
+
129
+ }
130
+
131
+ }
105
132
}
106
133
107
134
describe ( " simple operation " ) {
You can’t perform that action at this time.
0 commit comments