From d10e37a8293a0bc5331cb5c3bda600963c8e5a62 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Sun, 15 Aug 2021 08:38:02 +0300 Subject: [PATCH] add test for AsRef --- sdk/program/src/account_info.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sdk/program/src/account_info.rs b/sdk/program/src/account_info.rs index 4d45786088..084e08c807 100644 --- a/sdk/program/src/account_info.rs +++ b/sdk/program/src/account_info.rs @@ -266,4 +266,13 @@ mod tests { assert_eq!(k4, *info2_3_4[2].key); assert_eq!(k5, *info5.key); } + + #[test] + fn test_account_info_as_ref() { + let k = Pubkey::new_unique(); + let l = &mut 0; + let d = &mut [0u8]; + let info = AccountInfo::new(&k, false, false, l, d, &k, false, 0); + assert_eq!(info.key, info.as_ref().key); + } }