From c608d95a2451d110d3a90d6a3c3a6aa7fb293295 Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Thu, 18 Dec 2025 14:33:48 +0100 Subject: Add some details to presenation --- pbt/ts/src/bank.test.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'pbt/ts/src/bank.test.ts') 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); -- cgit v1.3.1