qubit-metadata 0.6.2

Type-safe metadata model with schemas and composable filters
Documentation
// =============================================================================
//    Copyright (c) 2025 - 2026 Haixing Hu.
//
//    SPDX-License-Identifier: Apache-2.0
//
//    Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Tests for borrowed metadata value serialization.

use qubit_metadata::Metadata;
use serde_json::json;
use serde_json::to_value;

#[test]
fn test_metadata_serializes_values_as_v1_payloads() {
    let metadata = Metadata::new().with("count", 7_i32);
    let encoded = to_value(metadata).expect("metadata should serialize through the borrowed adapter");

    assert_eq!(encoded["values"]["count"], json!({"scalar": {"int32": 7}}));
}