Skip to content

Commit

Permalink
#414: more TLA+ lite tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-kuprianov committed Aug 10, 2020
1 parent 0df4320 commit e9a099f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
26 changes: 26 additions & 0 deletions tendermint/tests/support/lite-model-based/LiteTests.tla
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,30 @@ TestSuccess ==

TestSuccessInv == ~TestSuccess

\* This test never produces a counterexample; so the model should be corrected
TestFailedTrustingPeriod ==
\E s \in DOMAIN history :
history[s].verdict = "FAILED_TRUSTING_PERIOD"

TestFailedTrustingPeriodInv == ~TestFailedTrustingPeriod

Test2CannotVerifySuccess ==
/\ state = "finishedSuccess"
/\ \E s1, s2 \in DOMAIN history :
/\ s1 /= s2
/\ history[s1].verdict = "CANNOT_VERIFY"
/\ history[s2].verdict = "CANNOT_VERIFY"

Test2CannotVerifySuccessInv == ~Test2CannotVerifySuccess

Test3CannotVerifySuccess ==
/\ state = "finishedSuccess"
/\ \E s1, s2, s3 \in DOMAIN history :
/\ s1 /= s2 /\ s2 /= s3 /\ s1 /= s3
/\ history[s1].verdict = "CANNOT_VERIFY"
/\ history[s2].verdict = "CANNOT_VERIFY"
/\ history[s3].verdict = "CANNOT_VERIFY"

Test3CannotVerifySuccessInv == ~Test3CannotVerifySuccess

============================================================================
3 changes: 1 addition & 2 deletions tendermint/tests/support/lite-model-based/MC4_4_faulty.tla
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ IS_PRIMARY_CORRECT == FALSE

VARIABLES
state, nextHeight, fetchedLightBlocks, lightBlockStatus, latestVerified,
prevVerified, prevChecked, prevTime, prevVerdict,
nprobes,
history, nprobes,
now, blockchain, Faulty

INSTANCE LiteTests
Expand Down

0 comments on commit e9a099f

Please sign in to comment.