Fix off-by-one error in error column numbers

It turns out that marker column values from Saphyr are not actually 1-indexed.
This commit is contained in:
Oliver Hamlet
2025-12-22 21:01:33 +00:00
parent b6d864ebd6
commit fa97ac8b5d
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -96,7 +96,7 @@ impl std::fmt::Display for ParseMetadataError {
f,
"encountered a YAML parsing error at line {} column {}: {}",
self.marker.line(),
self.marker.col(),
self.marker.col() + 1,
self.reason
)
}
@@ -357,7 +357,7 @@ impl std::fmt::Display for YamlMergeKeyError {
f,
"invalid YAML merge key value at line {} column {}: {}",
self.start.line(),
self.start.col(),
self.start.col() + 1,
self.yaml
)
}
+2 -2
View File
@@ -90,7 +90,7 @@ mod tests {
let error_message = process_merge_keys(yaml).unwrap_err().to_string();
assert_eq!(
"invalid YAML merge key value at line 3 column 6: test",
"invalid YAML merge key value at line 3 column 7: test",
error_message
);
}
@@ -108,7 +108,7 @@ mod tests {
let error_message = process_merge_keys(yaml).unwrap_err().to_string();
assert_eq!(
"invalid YAML merge key value at line 4 column 17: test",
"invalid YAML merge key value at line 4 column 18: test",
error_message
);
}