Skip to content

Commit

Permalink
Fix moc-cli test (and add a end-of-line in ASCII ser)
Browse files Browse the repository at this point in the history
  • Loading branch information
fxpineau committed May 27, 2024
1 parent 78446e3 commit 21d4888
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions crates/cli/test/resources/xmmlog.stmoc.t24.s7.expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9532,3 +9532,4 @@ t24/1546134
s7/84533
t24/1546136
s7/26172 169572
t24/ s7/
Original file line number Diff line number Diff line change
Expand Up @@ -26775,3 +26775,4 @@ t35/3166486703 3166486867
s10/1675040
t35/3166487562
s10/10852634
t35/ s10/
4 changes: 2 additions & 2 deletions src/deser/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion src/moc2d/range/op/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, Time<u64>, u64, Hpx<u64>>(left)
.unwrap()
Expand Down

0 comments on commit 21d4888

Please sign in to comment.