cairo-lang-test-runner

Crates.iocairo-lang-test-runner
lib.rscairo-lang-test-runner
version2.9.0-dev.0
sourcesrc
created_at2023-01-04 07:47:18.865744
updated_at2024-10-20 19:07:45.881773
descriptionCairo tests runner. Used to run tests written in Cairo.
homepage
repositoryhttps://github.com/starkware-libs/cairo/
max_upload_size
id750724
size47,562
(orizi)

documentation

README

Testing cairo files

cargo run --bin cairo-test -- --single-file /path/to/file.cairo

We can use this command to run Cairo level tests.

Example

#[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

Longer example can be found at Core Library Test.

cargo run --bin cairo-test -- corelib/

Filtering

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
Commit count: 5919

cargo fmt