Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert example does not compile #114

Open
clacladev opened this issue Sep 26, 2023 · 0 comments
Open

Assert example does not compile #114

clacladev opened this issue Sep 26, 2023 · 0 comments

Comments

@clacladev
Copy link

clacladev commented Sep 26, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant