diff options
| author | Arnaud Bailly <arnaud@pankzsoft.com> | 2025-12-18 14:33:48 +0100 |
|---|---|---|
| committer | Arnaud Bailly <arnaud@pankzsoft.com> | 2025-12-18 14:33:48 +0100 |
| commit | c608d95a2451d110d3a90d6a3c3a6aa7fb293295 (patch) | |
| tree | 655c0501bac4adfb6ccb116a54c32dcaf0aad022 /pbt/ts/src/bank.test.ts | |
| parent | fc4ba27f71e8a806d95fb441c1ee2e8e065b48fe (diff) | |
| download | lambda-nantes-c608d95a2451d110d3a90d6a3c3a6aa7fb293295.tar.gz | |
Add some details to presenation
Diffstat (limited to 'pbt/ts/src/bank.test.ts')
| -rw-r--r-- | pbt/ts/src/bank.test.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/pbt/ts/src/bank.test.ts b/pbt/ts/src/bank.test.ts index 3b40573..021e4c6 100644 --- a/pbt/ts/src/bank.test.ts +++ b/pbt/ts/src/bank.test.ts @@ -143,6 +143,30 @@ describe('Bank Simulator', () => { // // + test('in-mem bank conforms to model', async () => { + const prop = forall(genAccounts, async accounts => { + return property(genOperations(accounts), async ops => { + const simpleBank = new SimpleBank(accounts); + + return bankImplementationMatchesModel(accounts)(simpleBank)(ops); + }); + }); + + const result = await Property.run(prop); + + console.log(result); + console.log(JSON.stringify(result.counterexample)); + + expect(result.result).toBe('OK'); + }); + + // + // + // + // + // + // + test('can retrieve balance given account exists', async () => { const prop = forall(genAccounts, async accounts => { const api = new SimpleBank(accounts); |
