Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 1.57 KB

File metadata and controls

65 lines (45 loc) · 1.57 KB

FlowALP Top-level Agent Instructions

This document provides top-level information to agents (Claude Code etc.). It is loaded into context automatically for all sessions in this repo, so keep it concise!

Testing

All Cadence test files are located in:

cadence/tests/*_test.cdc

IMPORTANT: Install Dependencies First

On a fresh clone, you MUST init submodules and install Flow dependencies before running tests:

git submodule update --init --recursive
flow deps install

Run All Tests

./run_tests.sh

Run Individual Test Files

To run a specific test file:

flow test <path/to/test_file.cdc>

Example:

flow test cadence/tests/liquidation_phase1_test.cdc

Run Individual Tests by Name

IMPORTANT: To run a specific test function by name, you must specify the file path:

flow test <path/to/test_file.cdc> --name <test_function_name>

Example:

# Run a specific test from a multi-test file
flow test cadence/tests/interest_accrual_integration_test.cdc --name test_combined_all_interest_scenarios

Find all tests in a file

grep "fun test" cadence/tests/interest_accrual_integration_test.cdc

Cadence Coding Guidelines

  • Use string templating, not concatenation: "Hello \(name)" not "Hello ".concat(name)
  • Use equalWithinVariance from test_helpers.cdc for equality assertions where rounding errors are possible
  • Use red-green TDD for bug fixes and extensions to functionality. Tests must use assertions (eg. Test.assert) to verify expected behaviour, not logs.