Parse the `attrs[0]` int64 from a single ARRAY_SLICE result row. `SELECT *` over ARRAY_SLICE expands to one pgwire field per declared column. This test uses the column-0 helper, which lands on the `attrs` JSON-array column for the slice TVF (e.g. `[99]`). Older codecs returned the full `{"coords": [...], "attrs": [v]}` envelope in that slot — accept either shape so the test stays robust to the
(row: &str)
| 62 | /// in that slot — accept either shape so the test stays robust to the |
| 63 | /// projection tightening. |
| 64 | fn parse_int_attr(row: &str) -> i64 { |
| 65 | let v: serde_json::Value = |
| 66 | serde_json::from_str(row).unwrap_or_else(|e| panic!("row is not JSON: {row}: {e}")); |
| 67 | let arr = match v { |
| 68 | // Bare attrs array — `[99]`. |
| 69 | serde_json::Value::Array(a) => a, |
| 70 | // Envelope with `attrs` field. |
| 71 | serde_json::Value::Object(map) => map |
| 72 | .get("attrs") |
| 73 | .and_then(|a| a.as_array()) |
| 74 | .cloned() |
| 75 | .unwrap_or_else(|| panic!("envelope missing attrs array: {row}")), |
| 76 | _ => panic!("row is neither array nor object: {row}"), |
| 77 | }; |
| 78 | arr.first() |
| 79 | .and_then(|n| n.as_i64()) |
| 80 | .unwrap_or_else(|| panic!("cannot extract attrs[0] as i64 from: {row}")) |
| 81 | } |
| 82 | |
| 83 | /// Bring up a 3-node cluster, write v1 then v2 of a cell at coord `x=0`, |
| 84 | /// capturing the system-time cutoff between the two writes. Assert that |
no test coverage detected