Unverified Commit fa994830 authored by trace-andreason's avatar trace-andreason Committed by GitHub

ink::test attributes in new template (#190)

* ink::test attributes in new template

* add use ink

* Update templates/new/lib.rs
Co-authored-by: Michael Müller's avatarMichael Müller <mich@elmueller.net>
Co-authored-by: Michael Müller's avatarMichael Müller <mich@elmueller.net>
parent c6ef7624
Pipeline #131699 passed with stages
in 3 minutes and 59 seconds
......@@ -52,15 +52,18 @@ mod {{name}} {
/// Imports all the definitions from the outer scope so we can use them here.
use super::*;
/// Imports `ink_lang` so we can use `#[ink::test]`.
use ink_lang as ink;
/// We test if the default constructor does its job.
#[test]
#[ink::test]
fn default_works() {
let {{name}} = {{camel_name}}::default();
assert_eq!({{name}}.get(), false);
}
/// We test a simple use case of our contract.
#[test]
#[ink::test]
fn it_works() {
let mut {{name}} = {{camel_name}}::new(false);
assert_eq!({{name}}.get(), false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment