File tree Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,69 @@ class OutputSpec: QuickSpec
129
129
}
130
130
131
131
}
132
+
133
+ context ( " .PlusMinus " ) {
134
+
135
+ it ( " `±` should print `-0` " ) {
136
+
137
+ p. input = " ± "
138
+ expect ( p. output!) . to ( equal ( " -0 " ) )
139
+
140
+ }
141
+
142
+ it ( " `1 ±` should print `-1` " ) {
143
+
144
+ p. input = " 1 "
145
+ expect ( p. output!) . to ( equal ( " 1 " ) )
146
+
147
+ p. input = " ± "
148
+ expect ( p. output!) . to ( equal ( " -1 " ) )
149
+
150
+ }
151
+
152
+ it ( " `1 . ±` should print `-1.` " ) {
153
+
154
+ p. input = " 1 "
155
+ expect ( p. output!) . to ( equal ( " 1 " ) )
156
+
157
+ p. input = " . "
158
+ expect ( p. output!) . to ( equal ( " 1. " ) )
159
+
160
+ p. input = " ± "
161
+ expect ( p. output!) . to ( equal ( " -1. " ) )
162
+
163
+ }
164
+
165
+ it ( " `1 . ±` should print `-1.` " ) {
166
+
167
+ p. input = " 1 "
168
+ expect ( p. output!) . to ( equal ( " 1 " ) )
169
+
170
+ p. input = " . "
171
+ expect ( p. output!) . to ( equal ( " 1. " ) )
172
+
173
+ p. input = " ± "
174
+ expect ( p. output!) . to ( equal ( " -1. " ) )
175
+
176
+ }
177
+
178
+ it ( " `1 1 1 ±` should print `-111` " ) {
179
+
180
+ p. input = " 1 "
181
+ expect ( p. output!) . to ( equal ( " 1 " ) )
182
+
183
+ p. input = " 1 "
184
+ expect ( p. output!) . to ( equal ( " 11 " ) )
185
+
186
+ p. input = " 1 "
187
+ expect ( p. output!) . to ( equal ( " 111 " ) )
188
+
189
+ p. input = " ± "
190
+ expect ( p. output!) . to ( equal ( " -111 " ) )
191
+
192
+ }
193
+
194
+ }
132
195
}
133
196
134
197
describe ( " simple operation " ) {
You can’t perform that action at this time.
0 commit comments