| 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() { |