Fix prefix 0s after deleting decimal point (#825)

This commit is contained in:
dovisutu
2020-01-03 18:21:12 +08:00
committed by Rudy Huyn
parent a21b4a2d1a
commit 9e52256196
3 changed files with 25 additions and 0 deletions

View File

@@ -252,6 +252,16 @@ namespace CalculatorEngineTests
m_calcInput.Backspace();
VERIFY_ARE_EQUAL(L"1.2", m_calcInput.ToString(10), L"Verify input after backspace.");
}
// Issue #817: Prefixed multiple zeros
TEST_METHOD(BackspaceZeroDecimalWithoutPrefixZeros)
{
m_calcInput.TryAddDigit(0, 10, false, L"999", 64, 32);
m_calcInput.TryAddDecimalPt();
VERIFY_ARE_EQUAL(L"0.", m_calcInput.ToString(10), L"Verify input before backspace.")
m_calcInput.Backspace();
m_calcInput.TryAddDigit(0, 10, false, L"999", 64, 32);
VERIFY_ARE_EQUAL(L"0", m_calcInput.ToString(10), L"Verify input after backspace.")
}
TEST_METHOD(SetDecimalSymbol)
{