mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-17 03:50:39 +01:00
Resolve the bug of C and add a test case
This commit is contained in:
parent
13ae2b25cf
commit
e6762dcec1
@ -42,6 +42,22 @@ public class MainActivityTest {
|
||||
checkResult("5");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clearComplexTest(){
|
||||
press(R.id.btn_1);
|
||||
press(R.id.btn_plus);
|
||||
press(R.id.btn_1);
|
||||
press(R.id.btn_decimal);
|
||||
press(R.id.btn_5);
|
||||
press(R.id.btn_5);
|
||||
press(R.id.btn_clear);
|
||||
press(R.id.btn_1);
|
||||
press(R.id.btn_equals);
|
||||
checkResult("2.51");
|
||||
checkFormula("1+1.51");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void additionTest() {
|
||||
press(R.id.btn_minus);
|
||||
|
@ -161,7 +161,6 @@ class CalculatorImpl(calculator: Calculator, val context: Context) {
|
||||
newValue = newValue.replace("\\.$".toRegex(), "")
|
||||
newValue = formatString(newValue)
|
||||
setValue(newValue)
|
||||
mBaseValue = Formatter.stringToDouble(newValue)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user