Skip to content

Commit fe9386e

Browse files
committed
Reproduce .PlusMinus + comma bug.
1 parent 146eaef commit fe9386e

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

ReactKitCalculatorTests/OutputSpec.swift

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,69 @@ class OutputSpec: QuickSpec
129129
}
130130

131131
}
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+
}
132195
}
133196

134197
describe("simple operation") {

0 commit comments

Comments
 (0)