mod test_utils; use gemma::chip8::computer::Chip8Computer; use std::fs; use std::io::prelude::*; use crate::test_utils::load_compressed_result; #[test] fn smoke() { assert!(true) } #[test] #[ignore] fn serialization_round_trip() { let original_computer = Chip8Computer::new(); let expected_json = load_compressed_result("smoke_001_round_trip_serialize_deserialize"); // Serialize the Chip8Computer instance let serialized = serde_json::to_string(&original_computer).expect("Serialization failed"); // Compare the serialized output to the expected JSON println!("Serialized Output: [{}]", serialized); assert_eq!( serialized.trim(), expected_json.trim(), "Serialized output does not match expected JSON" ); // Deserialize back to Chip8Computer and assert equality let deserialized_computer: Chip8Computer = serde_json::from_str(&serialized).expect("Deserialization failed"); assert_eq!( deserialized_computer, original_computer, "Deserialized instance does not match the original" ); } // // #[test] // fn computer_001_system_zero_state() { // let x = Chip8Computer::new(); // let expected_string = load_compressed_result("smoke_002_round_trip_serialize_deserialize.tflt").unwrap(); // let serialized = serde_json::to_string(&x).unwrap(); // assert_eq!(serialized, expected_string); // } //