use ros2msg::generator::{CodeGenerator, GeneratorConfig};
use ros2msg::idl::types::{BasicType, BasicTypeKind, IdlType};
#[test]
fn test_octet_type_mapping() {
let octet_type = IdlType::Basic(BasicType::from_kind(BasicTypeKind::Octet));
let config = GeneratorConfig::default();
let generator = CodeGenerator::new(config);
let rust_type = generator.map_idl_type_to_rust(&octet_type);
println!("IdlType: {:?}", octet_type);
println!("Rust type: {}", rust_type);
assert_eq!(rust_type, "u8", "octet should map to u8");
}
#[test]
fn test_octet_constant_mapping() {
let octet_type = IdlType::Basic(BasicType::from_kind(BasicTypeKind::Octet));
let config = GeneratorConfig::default();
let generator = CodeGenerator::new(config);
let rust_type = generator.map_idl_type_to_rust_for_constant(&octet_type);
println!("IdlType for constant: {:?}", octet_type);
println!("Rust type for constant: {}", rust_type);
assert_eq!(rust_type, "u8", "octet constant should map to u8");
}