| Crates.io | cairo-lang-test-runner |
| lib.rs | cairo-lang-test-runner |
| version | 2.12.4-dev.1 |
| created_at | 2023-01-04 07:47:18.865744+00 |
| updated_at | 2025-09-21 11:32:49.126602+00 |
| description | Cairo tests runner. Used to run tests written in Cairo. |
| homepage | |
| repository | https://github.com/starkware-libs/cairo/ |
| max_upload_size | |
| id | 750724 |
| size | 115,297 |
cargo run --bin cairo-test -- --single-file /path/to/file.cairo
We can use this command to run Cairo level tests.
#[test]
fn test_assert_true() {
// Asserts that true
assert(true, 'assert(true)');
}
#[test]
#[should_panic]
fn test_assert_false() {
assert(false, 'assert(false)');
}
Longer example can be found at Core Library Test.
cargo run --bin cairo-test -- corelib/
You can run only tests containing a given string using -f <filter_string>.
For example:
cargo run --bin cairo-test -- --single-file /path/to/file.cairo -f specific_test