From 21d488854f5b458b6c8ef26420d0c4d1322c7d59 Mon Sep 17 00:00:00 2001 From: fxpineau Date: Mon, 27 May 2024 15:48:00 +0200 Subject: [PATCH] Fix moc-cli test (and add a end-of-line in ASCII ser) --- crates/cli/test/resources/xmmlog.stmoc.t24.s7.expected.txt | 1 + crates/cli/test/resources/xmmlog.stmoc.t35.s10.expected.txt | 1 + src/deser/ascii.rs | 4 ++-- src/moc2d/range/op/mod.rs | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/cli/test/resources/xmmlog.stmoc.t24.s7.expected.txt b/crates/cli/test/resources/xmmlog.stmoc.t24.s7.expected.txt index ce8eb06..16b7608 100644 --- a/crates/cli/test/resources/xmmlog.stmoc.t24.s7.expected.txt +++ b/crates/cli/test/resources/xmmlog.stmoc.t24.s7.expected.txt @@ -9532,3 +9532,4 @@ t24/1546134 s7/84533 t24/1546136 s7/26172 169572 +t24/ s7/ diff --git a/crates/cli/test/resources/xmmlog.stmoc.t35.s10.expected.txt b/crates/cli/test/resources/xmmlog.stmoc.t35.s10.expected.txt index 9305f56..0b9ca7f 100644 --- a/crates/cli/test/resources/xmmlog.stmoc.t35.s10.expected.txt +++ b/crates/cli/test/resources/xmmlog.stmoc.t35.s10.expected.txt @@ -26775,3 +26775,4 @@ t35/3166486703 3166486867 s10/1675040 t35/3166487562 s10/10852634 +t35/ s10/ diff --git a/src/deser/ascii.rs b/src/deser/ascii.rs index 89c190a..5bbaea4 100644 --- a/src/deser/ascii.rs +++ b/src/deser/ascii.rs @@ -387,7 +387,7 @@ where to_ascii_ivoa(moc2_it, fold, use_range_len, &mut writer)?; } // Always write maximum depth in both dimensions - write!(&mut writer, "{}{}/ {}{}/", Q::PREFIX, d1, R::PREFIX, d2).map_err(AsciiError::Io) + write!(&mut writer, "{}{}/ {}{}/\n", Q::PREFIX, d1, R::PREFIX, d2).map_err(AsciiError::Io) } /// This serialization is less compact than the IVOA ASCII serialization @@ -794,7 +794,7 @@ mod tests { .to_ascii_ivoa(None, false, &mut res_ascii) .unwrap(); let ascii = from_utf8(res_ascii.as_ref()).unwrap(); - let expected = "t12/ s8/"; + let expected = "t12/ s8/\n"; // println!("moc: {}", ascii); assert_eq!(ascii, expected); diff --git a/src/moc2d/range/op/mod.rs b/src/moc2d/range/op/mod.rs index 8804683..3a30d74 100644 --- a/src/moc2d/range/op/mod.rs +++ b/src/moc2d/range/op/mod.rs @@ -353,7 +353,8 @@ s7/88307-88308 1412900-1412901 1412903 1412909 1412956 1412958-1412959 1413009 1413021 1413023 1413084 1413092-1413093 1415312 1415324 1415406 1415712 1415714 1415726 1415808-1415810 -t29/ s10/"#; +t29/ s10/ +"#; let left_it = moc2d_from_ascii_ivoa::, u64, Hpx>(left) .unwrap()