| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- // SPDX-License-Identifier: Apache-2.0
- use crate::build_solidity_with_options;
- #[test]
- fn debug_buffer_format() {
- let mut runtime = build_solidity_with_options(
- r#"contract DebugBuffer {
- function multiple_prints() public {
- print("Hello!");
- print("I call seal_debug_message under the hood!");
- }
- function multiple_prints_then_revert() public {
- print("Hello!");
- print("I call seal_debug_message under the hood!");
- revert("sesa!!!");
- }
- }
- "#,
- true,
- true,
- );
- runtime.function("multiple_prints", [].to_vec());
- assert_eq!(
- runtime.printbuf,
- r#"print: Hello!,
- call: seal_debug_message=0,
- print: I call seal_debug_message under the hood!,
- call: seal_debug_message=0,
- "#
- );
- runtime.printbuf.clear();
- runtime.function_expect_failure("multiple_prints_then_revert", [].to_vec());
- assert_eq!(
- runtime.printbuf,
- r#"print: Hello!,
- call: seal_debug_message=0,
- print: I call seal_debug_message under the hood!,
- call: seal_debug_message=0,
- runtime_error: sesa!!! revert encountered in test.sol:10:17-23,
- call: seal_debug_message=0,
- "#
- );
- }
|