Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

Use #[ink::test] instead of #[test] #112

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion 1/assets/1.1-finished-code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ mod incrementer {

#[cfg(test)]
mod tests {
#[test]
use super::*;
use ink_lang as ink;

#[ink::test]
fn default_works() {
// Test Your Contract
}
Expand Down
3 changes: 2 additions & 1 deletion 1/assets/1.2-finished-code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ mod incrementer {
#[cfg(test)]
mod tests {
use super::*;
use ink_lang as ink;

#[test]
#[ink::test]
fn default_works() {
Incrementer::default();
}
Expand Down
3 changes: 2 additions & 1 deletion 1/assets/1.2-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ mod incrementer {
#[cfg(test)]
mod tests {
use super::*;
use ink_lang as ink;

#[test]
#[ink::test]
fn default_works() {
Incrementer::default();
}
Expand Down
3 changes: 2 additions & 1 deletion 1/assets/1.3-finished-code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ mod incrementer {
#[cfg(test)]
mod tests {
use super::*;
use ink_lang as ink;

#[test]
#[ink::test]
fn default_works() {
let contract = Incrementer::default();
assert_eq!(contract.get(), 0);
Expand Down
3 changes: 2 additions & 1 deletion 1/assets/1.3-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ mod incrementer {
#[cfg(test)]
mod tests {
use super::*;
use ink_lang as ink;

#[test]
#[ink::test]
fn default_works() {
let contract = Incrementer::default();
assert_eq!(contract.get(), 0);
Expand Down
5 changes: 3 additions & 2 deletions 1/assets/1.4-finished-code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ mod incrementer {
#[cfg(test)]
mod tests {
use super::*;
use ink_lang as ink;

#[test]
#[ink::test]
fn default_works() {
let contract = Incrementer::default();
assert_eq!(contract.get(), 0);
}

#[test]
#[ink::test]
fn it_works() {
let mut contract = Incrementer::new(42);
assert_eq!(contract.get(), 42);
Expand Down
5 changes: 3 additions & 2 deletions 1/assets/1.4-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ mod incrementer {
#[cfg(test)]
mod tests {
use super::*;
use ink_lang as ink;

#[test]
#[ink::test]
fn default_works() {
let contract = Incrementer::default();
assert_eq!(contract.get(), 0);
}

#[test]
#[ink::test]
fn it_works() {
let mut contract = Incrementer::new(42);
assert_eq!(contract.get(), 42);
Expand Down
4 changes: 2 additions & 2 deletions 1/assets/1.5-finished-code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ mod incrementer {

use ink_lang as ink;

#[test]
#[ink::test]
fn default_works() {
let contract = Incrementer::default();
assert_eq!(contract.get(), 0);
}

#[test]
#[ink::test]
fn it_works() {
let mut contract = Incrementer::new(42);
assert_eq!(contract.get(), 42);
Expand Down
4 changes: 2 additions & 2 deletions 1/assets/1.5-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ mod incrementer {
// Alias `ink_lang` so we can use `ink::test`.
use ink_lang as ink;

#[test]
#[ink::test]
fn default_works() {
let contract = Incrementer::default();
assert_eq!(contract.get(), 0);
}

#[test]
#[ink::test]
fn it_works() {
let mut contract = Incrementer::new(42);
assert_eq!(contract.get(), 42);
Expand Down
4 changes: 2 additions & 2 deletions 1/assets/1.6-finished-code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ mod incrementer {

use ink_lang as ink;

#[test]
#[ink::test]
fn default_works() {
let contract = Incrementer::default();
assert_eq!(contract.get(), 0);
}

#[test]
#[ink::test]
fn it_works() {
let mut contract = Incrementer::new(42);
assert_eq!(contract.get(), 42);
Expand Down
4 changes: 2 additions & 2 deletions 1/assets/1.6-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ mod incrementer {

use ink_lang as ink;

#[test]
#[ink::test]
fn default_works() {
let contract = Incrementer::default();
assert_eq!(contract.get(), 0);
}

#[test]
#[ink::test]
fn it_works() {
let mut contract = Incrementer::new(42);
assert_eq!(contract.get(), 42);
Expand Down