use prompty::model::ArrayProperty;
use prompty::model::context::{LoadContext, SaveContext};
#[test]
fn test_array_property_load_json() {
let json = r####"
{
"items": {
"kind": "string"
}
}
"####;
let result = ArrayProperty::from_json(json, &LoadContext::default());
assert!(result.is_ok(), "Failed to load from JSON: {:?}", result.err());
let instance = result.unwrap();
let _ = instance; }
#[test]
fn test_array_property_load_yaml() {
let yaml = r####"
items:
kind: string
"####;
let result = ArrayProperty::from_yaml(yaml, &LoadContext::default());
assert!(result.is_ok(), "Failed to load from YAML: {:?}", result.err());
let instance = result.unwrap();
let _ = instance; }
#[test]
fn test_array_property_roundtrip() {
let json = r####"
{
"items": {
"kind": "string"
}
}
"####;
let result = ArrayProperty::from_json(json, &LoadContext::default());
assert!(result.is_ok(), "Failed to load: {:?}", result.err());
let instance = result.unwrap();
let json_output = instance.to_json(&SaveContext::default());
assert!(json_output.is_ok(), "Failed to serialize to JSON: {:?}", json_output.err());
}