Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.
This repository was archived by the owner on May 6, 2025. It is now read-only.

Assert example does not compile #114

Open
@clacladev

Description

@clacladev

I copied and pasted the content of the assert example in a file called assert.cairo:

fn main(x: felt252, y: felt252) {
    assert(x != y, 'error, x is equal to y');
}

#[test]
fn test_main() {
    main(1,2);
}

Then compiling with the suggested command fails:

> cairo-test assert.cairo
Error: The given path is a file, but --single-file was not supplied.

So I compile with the suggested flag, but I get a ton of errors similar to this one:

> cairo-test --single-file assert.cairo
error: Expected function, found module.
 --> assert.cairo:2:5
    assert(x != y, 'error: x is equal to y');
    ^****^

Any ideas why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions