From 221a981cac60459e03a898e4aea7bba97847549e Mon Sep 17 00:00:00 2001 From: jolestar Date: Wed, 11 Oct 2023 17:18:32 +0800 Subject: [PATCH] fix test --- .../tests/cases/object/basic.exp | 18 +++++++++--------- .../tests/cases/object/basic.move | 2 -- .../tests/cases/object/object_cap.exp | 19 +++++++++++-------- .../tests/cases/object/object_cap.move | 1 - 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/crates/rooch-framework-tests/tests/cases/object/basic.exp b/crates/rooch-framework-tests/tests/cases/object/basic.exp index 80f6ddeaea..fbfee54657 100644 --- a/crates/rooch-framework-tests/tests/cases/object/basic.exp +++ b/crates/rooch-framework-tests/tests/cases/object/basic.exp @@ -1,32 +1,32 @@ processed 10 tasks -task 1 'publish'. lines 3-45: +task 1 'publish'. lines 3-40: status EXECUTED -task 2 'run'. lines 47-47: +task 2 'run'. lines 42-42: status EXECUTED -task 3 'view_object'. lines 49-51: +task 3 'view_object'. lines 44-46: Object { id: ObjectID(ae43e34e51db9c833ab50dd9aa8b27106519e5bbfd533737306e7b69ef253647), owner: 0000000000000000000000000000000000000000000000000000000000000043, value: AnnotatedMoveStruct { abilities: [Store, Key, ], type_: StructTag { address: 0000000000000000000000000000000000000000000000000000000000000042, module: Identifier("m"), name: Identifier("S"), type_params: [] }, value: [(Identifier("v"), U8(1))] } } -task 4 'run'. lines 53-53: +task 4 'run'. lines 48-48: status EXECUTED -task 5 'view_object'. lines 55-58: +task 5 'view_object'. lines 50-53: Object { id: ObjectID(0bbaf311ae6768a532b1f9dee65b1758a7bb1114fd57df8fa94cb2d1cb5f6896), owner: 0000000000000000000000000000000000000000000000000000000000000043, value: AnnotatedMoveStruct { abilities: [Store, Key, ], type_: StructTag { address: 0000000000000000000000000000000000000000000000000000000000000042, module: Identifier("m"), name: Identifier("Cup"), type_params: [Struct(StructTag { address: 0000000000000000000000000000000000000000000000000000000000000042, module: Identifier("m"), name: Identifier("S"), type_params: [] })] }, value: [(Identifier("v"), U8(2))] } } -task 6 'run'. lines 60-60: +task 6 'run'. lines 55-55: status EXECUTED -task 7 'view'. lines 62-64: +task 7 'view'. lines 57-59: store key 0x42::m::S { v: 1u8 } -task 8 'run'. lines 66-66: +task 8 'run'. lines 61-61: status EXECUTED -task 9 'view'. lines 68-68: +task 9 'view'. lines 63-63: store key 0x42::m::Cup<0x42::m::S> { v: 2u8 } diff --git a/crates/rooch-framework-tests/tests/cases/object/basic.move b/crates/rooch-framework-tests/tests/cases/object/basic.move index 9ad83b00d0..e92fc048ac 100644 --- a/crates/rooch-framework-tests/tests/cases/object/basic.move +++ b/crates/rooch-framework-tests/tests/cases/object/basic.move @@ -4,7 +4,6 @@ module test::m { use moveos_std::context::{Self, Context}; - use moveos_std::object; use moveos_std::object_id::ObjectID; use moveos_std::account_storage; use std::debug; @@ -34,7 +33,6 @@ module test::m { public entry fun move_cup_to_global(ctx: &mut Context, sender: signer, object_id: ObjectID) { let (_id,_owner,value) = context::remove_object>(ctx, object_id); - debug::print(&obj); account_storage::global_move_to(ctx, &sender, value); } } diff --git a/crates/rooch-framework-tests/tests/cases/object/object_cap.exp b/crates/rooch-framework-tests/tests/cases/object/object_cap.exp index 0556df7bd4..5d5edb4c05 100644 --- a/crates/rooch-framework-tests/tests/cases/object/object_cap.exp +++ b/crates/rooch-framework-tests/tests/cases/object/object_cap.exp @@ -3,14 +3,17 @@ processed 3 tasks task 1 'publish'. lines 3-21: status EXECUTED -task 2 'run'. lines 22-36: -Error: error[E01002]: unexpected token - ┌─ /tmp/tempfile:31:47 +task 2 'run'. lines 22-34: +Error: error: resource type "TestObject" in function "0x2::context::new_object" not defined in current module or not allowed + ┌─ /tmp/tempfile:29:23 │ -31 │ let context::remove_object(ctx, object_ref::id(&obj_ref)); - │ ^ - │ │ - │ Unexpected '(' - │ Expected '{' +29 │ let obj_ref = context::new_object(ctx, object); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: resource type "TestObject" in function "0x2::context::remove_object" not defined in current module or not allowed + ┌─ /tmp/tempfile:30:42 + │ +30 │ let (_id, _owner, test_object) = context::remove_object(ctx, object_ref::id(&obj_ref)); + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/crates/rooch-framework-tests/tests/cases/object/object_cap.move b/crates/rooch-framework-tests/tests/cases/object/object_cap.move index 4e0b7ec724..5912d197ac 100644 --- a/crates/rooch-framework-tests/tests/cases/object/object_cap.move +++ b/crates/rooch-framework-tests/tests/cases/object/object_cap.move @@ -22,7 +22,6 @@ module test::m { //# run --signers A script { use moveos_std::context::{Self, Context}; - use moveos_std::object; use moveos_std::object_ref; use test::m::{Self, TestObject};