-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ECO-1571] Add abstracted unit testing (#37)
Co-authored-by: Matt <[email protected]>
- Loading branch information
Showing
12 changed files
with
796 additions
and
584 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,12 @@ | ||
[addresses] | ||
emojicoin_dot_fun = "_" | ||
market_address = "_" | ||
coin_factory = "_" | ||
|
||
[dependencies.AptosFramework] | ||
[dev-dependencies.AptosFramework] | ||
git = "https://github.com/aptos-labs/aptos-core.git" | ||
rev = "mainnet" | ||
subdir = "aptos-move/framework/aptos-framework" | ||
|
||
[dev-addresses] | ||
emojicoin_dot_fun = "0xcccccccc" | ||
market_address = "0xbbbbbbbb" | ||
|
||
[dev-dependencies.EmojicoinDotFun] | ||
local = "../emojicoin_dot_fun" | ||
|
||
[package] | ||
name = "CoinFactory" | ||
upgrade_policy = "compatible" | ||
name = "EmojicoinDotFunCoinFactory" | ||
upgrade_policy = "immutable" | ||
version = "1.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,4 @@ | ||
module market_address::coin_factory { | ||
module coin_factory::coin_factory { | ||
struct Emojicoin {} | ||
struct EmojicoinLP {} | ||
|
||
#[test_only] use aptos_std::type_info::{Self}; | ||
#[test_only] use emojicoin_dot_fun::emojicoin_dot_fun; | ||
|
||
#[test] | ||
fun test_type_info_consts_correct() { | ||
let (module_name, emojicoin_struct, emojicoin_lp_struct) = | ||
emojicoin_dot_fun::get_COIN_FACTORY_TYPE_CONSTANTS(); | ||
|
||
let emojicoin_type_info = type_info::type_of<Emojicoin>(); | ||
let lp_type_info = type_info::type_of<EmojicoinLP>(); | ||
|
||
assert!(@market_address == type_info::account_address(&emojicoin_type_info), 0); | ||
assert!(@market_address == type_info::account_address(&lp_type_info), 0); | ||
assert!(module_name == type_info::module_name(&emojicoin_type_info), 0); | ||
assert!(module_name == type_info::module_name(&lp_type_info), 0); | ||
assert!(emojicoin_struct == type_info::struct_name(&emojicoin_type_info), 0); | ||
assert!(emojicoin_lp_struct == type_info::struct_name(&lp_type_info), 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.