refactor: Fix spelling issues in tests (#6199)

This change removes the `src/tests` exception from the `cspell` config and fixes all the issues that arise as a result. No functionality/test change.
This commit is contained in:
Mayukha Vadari
2026-02-06 15:30:22 -05:00
committed by GitHub
parent f5208fc850
commit bf4674f42b
38 changed files with 256 additions and 238 deletions

View File

@@ -79,8 +79,8 @@ public:
STAmount const initialRate = Quality(newOffer).rate();
std::uint32_t const bobOfferSeq = env.seq(bob);
STAmount const bobInitialBalance = env.balance(bob);
STAmount const bobsFee = env.current()->fees().base;
env(offer(bob, newOffer.in, newOffer.out, tfSell), fee(bobsFee));
STAmount const bobFee = env.current()->fees().base;
env(offer(bob, newOffer.in, newOffer.out, tfSell), fee(bobFee));
env.close();
STAmount const bobFinalBalance = env.balance(bob);
@@ -100,7 +100,7 @@ public:
amountFromJson(sfTakerGets, bobOffer[jss::node][sfTakerGets.jsonName]);
STAmount const reducedTakerPays =
amountFromJson(sfTakerPays, bobOffer[jss::node][sfTakerPays.jsonName]);
STAmount const bobGot = env.balance(bob) + bobsFee - bobInitialBalance;
STAmount const bobGot = env.balance(bob) + bobFee - bobInitialBalance;
BEAST_EXPECT(reducedTakerPays < newOffer.in);
BEAST_EXPECT(reducedTakerGets < newOffer.out);
STAmount const inLedgerRate = Quality(Amounts{reducedTakerPays, reducedTakerGets}).rate();
@@ -141,7 +141,7 @@ public:
};
// bob's offer (the new offer) is the same every time:
Amounts const bobsOffer{STAmount(XRP(1)), STAmount(USD.issue(), 1, 0)};
Amounts const bobOffer{STAmount(XRP(1)), STAmount(USD.issue(), 1, 0)};
// alice's offer has a slightly smaller TakerPays with each
// iteration. This should mean that the size of the offer bob
@@ -151,10 +151,10 @@ public:
mantissaReduce += 20'000'000ull)
{
STAmount aliceUSD{
bobsOffer.out.issue(), bobsOffer.out.mantissa() - mantissaReduce, bobsOffer.out.exponent()};
STAmount aliceXRP{bobsOffer.in.issue(), bobsOffer.in.mantissa() - 1};
Amounts alicesOffer{aliceUSD, aliceXRP};
blockedCount += exerciseOfferPair(alicesOffer, bobsOffer);
bobOffer.out.issue(), bobOffer.out.mantissa() - mantissaReduce, bobOffer.out.exponent()};
STAmount aliceXRP{bobOffer.in.issue(), bobOffer.in.mantissa() - 1};
Amounts aliceOffer{aliceUSD, aliceXRP};
blockedCount += exerciseOfferPair(aliceOffer, bobOffer);
}
// None of the test cases should produce a potentially blocking
@@ -279,9 +279,9 @@ public:
STAmount bobUSD{
aliceOffer.out.issue(), aliceOffer.out.mantissa() - mantissaReduce, aliceOffer.out.exponent()};
STAmount bobXRP{aliceOffer.in.issue(), aliceOffer.in.mantissa() - 1};
Amounts bobsOffer{bobUSD, bobXRP};
Amounts bobOffer{bobUSD, bobXRP};
blockedCount += exerciseOfferPair(aliceOffer, bobsOffer);
blockedCount += exerciseOfferPair(aliceOffer, bobOffer);
}
// None of the test cases should produce a potentially blocking
@@ -333,7 +333,7 @@ public:
// then we use that as evidence that bob's offer blocked the
// order book.
{
bool const bobsOfferGone = !offerInLedger(env, bob, bobOfferSeq);
bool const bobOfferGone = !offerInLedger(env, bob, bobOfferSeq);
STAmount const aliceBalanceUSD = env.balance(alice, USD);
// Sanity check the ledger if alice got USD.
@@ -341,11 +341,11 @@ public:
{
BEAST_EXPECT(aliceBalanceUSD == initialBobUSD);
BEAST_EXPECT(env.balance(bob, USD) == USD(0));
BEAST_EXPECT(bobsOfferGone);
BEAST_EXPECT(bobOfferGone);
}
// Track occurrences of order book blocking.
if (!bobsOfferGone && aliceBalanceUSD.signum() == 0)
if (!bobOfferGone && aliceBalanceUSD.signum() == 0)
{
++blockedOrderBookCount;
}
@@ -423,13 +423,13 @@ public:
// Examine the aftermath of alice's offer.
{
bool const bobsOfferGone = !offerInLedger(env, bob, bobOfferSeq);
bool const bobOfferGone = !offerInLedger(env, bob, bobOfferSeq);
STAmount aliceBalanceUSD = env.balance(alice, USD);
#if 0
std::cout
<< "bobs initial: " << initialBobUSD
<< "bob initial: " << initialBobUSD
<< "; alice final: " << aliceBalanceUSD
<< "; bobs offer: " << bobsOfferJson.toStyledString()
<< "; bob offer: " << bobOfferJson.toStyledString()
<< std::endl;
#endif
// Sanity check the ledger if alice got USD.
@@ -437,11 +437,11 @@ public:
{
BEAST_EXPECT(aliceBalanceUSD == initialBobUSD);
BEAST_EXPECT(env.balance(bob, USD) == USD(0));
BEAST_EXPECT(bobsOfferGone);
BEAST_EXPECT(bobOfferGone);
}
// Track occurrences of order book blocking.
if (!bobsOfferGone && aliceBalanceUSD.signum() == 0)
if (!bobOfferGone && aliceBalanceUSD.signum() == 0)
{
++blockedOrderBookCount;
}