module 0x2::A { use std::signer; struct R has key { f1: bool, f2: u64, } #[test(s=@0x2)] public fun check_global_basics_ok(s: &signer) { let a = signer::address_of(s); spec { assert !exists(a); }; let r = R { f1: true, f2: 1 }; move_to(s, r); spec { assert exists(a); assert global(a).f1; assert global(a) == R { f1: true, f2: 1 }; }; } #[test(s=@0x2)] public fun check_global_basics_fail(s: &signer) { let a = signer::address_of(s); spec { assert global(a).f2 == 42; }; } }