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

Native support for unit testing in Leo #2

Closed
howardwu opened this issue Apr 21, 2020 · 1 comment
Closed

Native support for unit testing in Leo #2

howardwu opened this issue Apr 21, 2020 · 1 comment
Labels
feature A new feature.

Comments

@howardwu
Copy link
Member

No description provided.

@howardwu howardwu added the feature A new feature. label Apr 21, 2020
@collinc97
Copy link
Collaborator

Proposed testing syntax:

Use the test keyword to add tests to a leo program. Tests must have 0 function inputs and 0 function returns.

function main(a: u32) -> u32 {
    return a
}

test function expect_pass() {
  let a = 1u32;

  let res = main(a);

  assert_eq!(res, 1u32);
}

test function expect_fail() {
  assert_eq!(1u8, 0u8);
}

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

No branches or pull requests

2 participants