MCPcopy Create free account
hub / github.com/ProvableHQ/sdk / test_program_from_methods

Function test_program_from_methods

wasm/src/programs/program.rs:923–935  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

921
922 #[wasm_bindgen_test]
923 fn test_program_from_methods() {
924 // Test the from_string creates a valid object and to_string matches the source string
925 let program_string = ProgramNative::credits().unwrap().to_string();
926 let program = Program::from_string(&program_string).unwrap();
927 assert_eq!(program_string, program.to_string());
928
929 // Test the to and from methods from the native objects work
930 let program_native = ProgramNative::from_str(&program.to_string()).unwrap();
931 let program_from_native = Program::from(program_native.clone());
932 assert_eq!(program, program_from_native);
933 let native_from_program = ProgramNative::from(program);
934 assert_eq!(program_native, native_from_program);
935 }
936
937 #[wasm_bindgen_test]
938 fn test_get_imports() {

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected