From 47356f978764d37457749b7cc0dd7739b20ede6a Mon Sep 17 00:00:00 2001 From: joii Date: Tue, 16 Apr 2024 14:53:21 +0800 Subject: [PATCH] Add tests: about spawn load cells --- .../tests/ckb_latest/features_since_v2023.rs | 13 ++++- script/testdata/spawn_cases | Bin 15088 -> 15696 bytes script/testdata/spawn_cases.c | 46 +++++++++++++++++- 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/script/src/verify/tests/ckb_latest/features_since_v2023.rs b/script/src/verify/tests/ckb_latest/features_since_v2023.rs index fac884e630..9355153830 100644 --- a/script/src/verify/tests/ckb_latest/features_since_v2023.rs +++ b/script/src/verify/tests/ckb_latest/features_since_v2023.rs @@ -1158,7 +1158,6 @@ proptest! { #[test] fn check_spawn_close_invalid_fd() { let result = simple_spawn_test("testdata/spawn_cases", &[12]); - println!("--- err: {:?}", result); assert_eq!(result.is_ok(), SCRIPT_VERSION == ScriptVersion::V2); } @@ -1221,3 +1220,15 @@ fn check_spawn_huge_swap() { assert!(result.is_err()) } } + +#[test] +fn check_spawn_invaild_index() { + let result = simple_spawn_test("testdata/spawn_cases", &[17]); + assert_eq!(result.is_ok(), SCRIPT_VERSION == ScriptVersion::V2); +} + +#[test] +fn check_spawn_index_out_of_bound() { + let result = simple_spawn_test("testdata/spawn_cases", &[18]); + assert_eq!(result.is_ok(), SCRIPT_VERSION == ScriptVersion::V2); +} diff --git a/script/testdata/spawn_cases b/script/testdata/spawn_cases index e26caac38c43ca1daf52ec9b40162a4548aaed40..7d4a305ff39ed5214bf6daae7087b27dc536fc5f 100755 GIT binary patch delta 3181 zcma)8e^6A%9e?lOp2vaS(?jlu$8j7SKb{r=VLYzRC1C``nW)KJorx0%C`VE|5yXO1 z?T|Ze-W`!iD`ZV4$+Y6o7AbLr^lAukoWp4}jgjf4f27s6`a&Ixl+JsmkP&O7yKi^z z4%0vSX1?t1_vh#PW0zC9;>Y_-H2k**gsl~ojQUArWq5pM;le?ZH25slA`U#)4!q%A zqa2!Ps`YD|L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