MCPcopy Create free account
hub / github.com/douglance/devsql / test_jhistory_json_to_data_row

Function test_jhistory_json_to_data_row

crates/ccql/src/sql/composite_storage.rs:1185–1202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1183
1184 #[test]
1185 fn test_jhistory_json_to_data_row() {
1186 let json = serde_json::json!({
1187 "session_id": "abc123",
1188 "ts": 1754402102,
1189 "text": "hello codex"
1190 });
1191
1192 let Some(DataRow::Map(ref map)) = jhistory_json_to_data_row(&json) else {
1193 panic!("expected jhistory row");
1194 };
1195
1196 assert_eq!(
1197 map.get("display"),
1198 Some(&Value::Str("hello codex".to_string()))
1199 );
1200 assert_eq!(map.get("ts"), Some(&Value::I64(1754402102)));
1201 assert_eq!(map.get("timestamp"), Some(&Value::I64(1_754_402_102_000)));
1202 }
1203
1204 #[test]
1205 fn test_jhistory_json_to_data_row_with_string_numbers() {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected